public string GetDescription(IntPtr handle) { if (handle == IntPtr.Zero) { throw new ArgumentNullException("handle"); } using (var s = new CFString(CFCopyDescription(handle))) return(s.ToString()); }
public override string ToString() { if (copyDescription != IntPtr.Zero) { var ptr = CFReadStreamRef_InvokeCopyDescription(copyDescription, Info); if (ptr != IntPtr.Zero) { // Copy* -> so we must not retain again using (var s = new CFString(ptr, true)) return(s.ToString()); } } return(base.ToString()); }
void notification(CFString name, NSDictionary userInfo) { var evt = NotificationChanged; if (evt == null) return; evt (this,new NoticationEventArgs(name.ToString ())); }
static internal string GetFileSystemPath(IntPtr hcfurl) { using (var str = new CFString(CFURLCopyFileSystemPath(hcfurl, 0), true)) return(str.ToString()); }
public override string ToString() { using (var str = new CFString(CFURLGetString(handle))) { return(str.ToString()); } }
public static string GetDeviceIdentifier(IntPtr device) { IntPtr p = AMDeviceCopyDeviceIdentifier(device); CFString str = new CFString(p); return str.ToString(); }