Exemple #1
0
 static public CFUrl FromUrlString(string url, CFUrl baseurl)
 {
     // CFString ctor will throw an ANE if null
     using (var str = new CFString(url)){
         return(FromStringHandle(str.Handle, baseurl));
     }
 }
Exemple #2
0
        internal static CFUrl FromStringHandle(IntPtr cfstringHandle, CFUrl baseurl)
        {
            IntPtr handle = CFURLCreateWithString(IntPtr.Zero, cfstringHandle, baseurl != null ? baseurl.Handle : IntPtr.Zero);

            if (handle == IntPtr.Zero)
            {
                return(null);
            }
            return(new CFUrl(handle, true));
        }