// public static bool GetBooleanValue (IntPtr theDict, IntPtr key) // { // var value = GetValue (theDict, key); // if (value == IntPtr.Zero) // return false; // return CFBoolean.GetValue (value); // } public string GetStringValue(string key) { using (var str = new CFString(key)) { using (var value = new CFString(CFDictionaryGetValue(Handle, str.Handle))) { return(value.ToString()); } } }
static string GetError(OSStatus status) { CFString str = null; try { str = new CFString(SecCopyErrorMessageString(status, IntPtr.Zero), true); return(str.ToString()); } catch { return(status.ToString()); } finally { if (str != null) { str.Dispose(); } } }
static string GetError(OSStatus status) { CFString str = null; try { str = new CFString (SecCopyErrorMessageString (status, IntPtr.Zero), true); return str.ToString (); } catch { return status.ToString (); } finally { if (str != null) str.Dispose (); } }
// public static bool GetBooleanValue (IntPtr theDict, IntPtr key) // { // var value = GetValue (theDict, key); // if (value == IntPtr.Zero) // return false; // return CFBoolean.GetValue (value); // } public string GetStringValue(string key) { using (var str = new CFString (key)) { using (var value = new CFString (CFDictionaryGetValue (Handle, str.Handle))) { return value.ToString (); } } }