コード例 #1
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     return(SKIndexRemoveDocument(handle, document.Handle));
 }
コード例 #2
0
ファイル: SearchKit.cs プロジェクト: cwensley/xamarin-macios
 public bool RemoveDocument(SKDocument document)
 {
     if (document is null)
     {
         throw new ArgumentNullException(nameof(document));
     }
     return(SKIndexRemoveDocument(Handle, document.Handle));
 }
コード例 #3
0
        public bool AddDocument(SKDocument document, string mimeHint, bool canReplace)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            var ns = mimeHint == null ? null : new NSString(mimeHint);

            return(SKIndexAddDocument(handle, document.Handle, ns == null ? IntPtr.Zero : ns.Handle, canReplace));
        }
コード例 #4
0
 public void SetDocumentProperties(SKDocument document, NSDictionary dict)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     if (dict == null)
     {
         throw new ArgumentNullException("dict");
     }
     SKIndexSetDocumentProperties(handle, document.Handle, dict.Handle);
 }
コード例 #5
0
 public bool MoveDocument(SKDocument document, SKDocument newParent)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     if (newParent == null)
     {
         throw new ArgumentNullException("newParent");
     }
     return(SKIndexMoveDocument(handle, document.Handle, newParent.Handle));
 }
コード例 #6
0
ファイル: SearchKit.cs プロジェクト: cwensley/xamarin-macios
 public void SetDocumentProperties(SKDocument document, NSDictionary dict)
 {
     if (document is null)
     {
         throw new ArgumentNullException(nameof(document));
     }
     if (dict is null)
     {
         throw new ArgumentNullException(nameof(dict));
     }
     SKIndexSetDocumentProperties(Handle, document.Handle, dict.Handle);
 }
コード例 #7
0
ファイル: SearchKit.cs プロジェクト: cwensley/xamarin-macios
 public bool MoveDocument(SKDocument document, SKDocument newParent)
 {
     if (document is null)
     {
         throw new ArgumentNullException(nameof(document));
     }
     if (newParent is null)
     {
         throw new ArgumentNullException(nameof(newParent));
     }
     return(SKIndexMoveDocument(Handle, document.Handle, newParent.Handle));
 }
コード例 #8
0
 public bool RenameDocument(SKDocument document, string newName)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     if (newName == null)
     {
         throw new ArgumentNullException("newName");
     }
     using (var ns = new NSString(newName))
         return(SKIndexRenameDocument(handle, document.Handle, ns.Handle));
 }
コード例 #9
0
ファイル: SearchKit.cs プロジェクト: cwensley/xamarin-macios
        public bool AddDocument(SKDocument document, string mimeHint, bool canReplace)
        {
            if (document is null)
            {
                throw new ArgumentNullException(nameof(document));
            }
            var mimeHintHandle = CFString.CreateNative(mimeHint);

            try {
                return(SKIndexAddDocument(Handle, document.Handle, mimeHintHandle, canReplace));
            } finally {
                CFString.ReleaseNative(mimeHintHandle);
            }
        }
コード例 #10
0
        public bool AddDocumentWithText(SKDocument document, string text, bool canReplace)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            var ns = text == null ? null : new NSString(text);

            try {
                return(SKIndexAddDocumentWithText(handle, document.Handle, ns == null ? IntPtr.Zero : ns.Handle, canReplace));
            } finally {
                if (ns != null)
                {
                    ns.Dispose();
                }
            }
        }
コード例 #11
0
ファイル: SearchKit.cs プロジェクト: cwensley/xamarin-macios
        public bool RenameDocument(SKDocument document, string newName)
        {
            if (document is null)
            {
                throw new ArgumentNullException(nameof(document));
            }
            if (newName is null)
            {
                throw new ArgumentNullException(nameof(newName));
            }
            var newNameHandle = CFString.CreateNative(newName);

            try {
                return(SKIndexRenameDocument(Handle, document.Handle, newNameHandle));
            } finally {
                CFString.ReleaseNative(newNameHandle);
            }
        }
コード例 #12
0
        public SKDocument(string name, SKDocument parent = null, string scheme = null)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            var ss = scheme == null ? null : new NSString(scheme);

            using (var nn = new NSString(name))
                handle = SKDocumentCreate(ss == null ? IntPtr.Zero : ss.Handle, parent == null ? IntPtr.Zero : parent.Handle, nn.Handle);
            if (ss != null)
            {
                ss.Dispose();
            }
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentNullException("Failed to create the specified document");
            }
        }