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()); }
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()); } }