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)); }
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); } }
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)); } }
extern static IntPtr SKIndexCreateWithMutableData(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
extern static IntPtr SKIndexCreateWithURL(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
static extern IntPtr SKIndexCreateWithURL(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
static extern IntPtr SKIndexCreateWithMutableData(IntPtr url, IntPtr str, SKIndexType type, IntPtr dict);
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); }
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); } }