Beispiel #1
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     return(SKIndexRemoveDocument(handle, document.Handle));
 }
Beispiel #2
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document is null)
     {
         throw new ArgumentNullException(nameof(document));
     }
     return(SKIndexRemoveDocument(Handle, document.Handle));
 }
Beispiel #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));
        }
Beispiel #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);
 }
Beispiel #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));
 }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 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));
 }
Beispiel #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));
 }
Beispiel #9
0
        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);
            }
        }
Beispiel #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();
                }
            }
        }
Beispiel #11
0
        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);
            }
        }
Beispiel #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");
            }
        }