Beispiel #1
0
        public string GetDescription(IntPtr handle)
        {
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentNullException("handle");
            }

            using (var s = new CFString(CFCopyDescription(handle)))
                return(s.ToString());
        }
Beispiel #2
0
 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());
 }
Beispiel #3
0
 static internal string GetFileSystemPath(IntPtr hcfurl)
 {
     using (var str = new CFString(CFURLCopyFileSystemPath(hcfurl, 0), true))
         return(str.ToString());
 }
Beispiel #4
0
 public override string ToString()
 {
     using (var str = new CFString(CFURLGetString(handle))) {
         return(str.ToString());
     }
 }