Пример #1
0
        public static SKIndex CreateWithUrl(NSUrl url, string indexName, SKIndexType type, SKTextAnalysis analysisProperties)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }
            var cfstr = indexName == null ? null : new NSString(indexName);

            var h = SKIndexCreateWithURL(url.Handle, cfstr == null ? IntPtr.Zero : cfstr.Handle, type, analysisProperties == null ? IntPtr.Zero : analysisProperties.Dictionary.Handle);

            cfstr.Dispose();
            if (h == IntPtr.Zero)
            {
                return(null);
            }
            return(new SKIndex(h));
        }
Пример #2
0
        public static SKIndex?CreateWithUrl(NSUrl url, string indexName, SKIndexType type, SKTextAnalysis analysisProperties)
        {
            if (url is null)
            {
                throw new ArgumentNullException(nameof(url));
            }
            var indexNameHandle = CFString.CreateNative(indexName);

            try {
                var handle = SKIndexCreateWithURL(url.Handle, indexNameHandle, type, analysisProperties.GetHandle());
                if (handle == IntPtr.Zero)
                {
                    return(null);
                }
                return(new SKIndex(handle, true));
            } finally {
                CFString.ReleaseNative(indexNameHandle);
            }
        }
Пример #3
0
 public static SKIndex CreateWithMutableData(NSMutableData data, string indexName, SKIndexType type, SKTextAnalysis analysisProperties)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (indexName == null)
     {
         throw new ArgumentNullException("indexName");
     }
     using (var cfstr = new NSString(indexName)) {
         var h = SKIndexCreateWithMutableData(data.Handle, cfstr.Handle, type, analysisProperties == null ? IntPtr.Zero : analysisProperties.Dictionary.Handle);
         if (h == IntPtr.Zero)
         {
             return(null);
         }
         return(new SKIndex(h));
     }
 }
Пример #4
0
 extern static IntPtr SKIndexCreateWithMutableData(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
Пример #5
0
 extern static IntPtr SKIndexCreateWithURL(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
Пример #6
0
 static extern IntPtr SKIndexCreateWithURL(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
Пример #7
0
 static extern IntPtr SKIndexCreateWithMutableData(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
Пример #8
0
        public static SKIndex CreateWithUrl(NSUrl url, string indexName, SKIndexType type, SKTextAnalysis analysisProperties)
        {
            if (url == null)
                throw new ArgumentNullException ("url");
            var cfstr = indexName == null ? null : new NSString (indexName);

            var h = SKIndexCreateWithURL (url.Handle, cfstr == null ? IntPtr.Zero : cfstr.Handle, type, analysisProperties == null ? IntPtr.Zero : analysisProperties.Dictionary.Handle);
            cfstr.Dispose ();
            if (h == IntPtr.Zero)
                return null;
            return new SKIndex (h);
        }
Пример #9
0
 public static SKIndex CreateWithMutableData(NSMutableData data, string indexName, SKIndexType type, SKTextAnalysis analysisProperties)
 {
     if (data == null)
         throw new ArgumentNullException ("data");
     if (indexName == null)
         throw new ArgumentNullException ("indexName");
     using (var cfstr = new NSString (indexName)) {
         var h = SKIndexCreateWithMutableData (data.Handle, cfstr.Handle, type, analysisProperties == null ? IntPtr.Zero : analysisProperties.Dictionary.Handle);
         if (h == IntPtr.Zero)
             return null;
         return new SKIndex (h);
     }
 }