CPF/CPF.Mac/Mac/CoreFoundation/CFMutableDictionary.cs
2023-11-21 23:05:03 +08:00

22 lines
605 B
C#

using System;
using System.Runtime.InteropServices;
namespace CPF.Mac.CoreFoundation
{
internal static class CFMutableDictionary
{
[DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
private static extern void CFDictionarySetValue(IntPtr theDict, IntPtr key, IntPtr value);
public static void SetValue(IntPtr theDict, IntPtr key, IntPtr value)
{
CFDictionarySetValue(theDict, key, value);
}
public static void SetValue(IntPtr theDict, IntPtr key, bool value)
{
SetValue(theDict, key, value ? CFBoolean.True.Handle : CFBoolean.False.Handle);
}
}
}