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 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 #3
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 #4
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 #5
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 #6
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");
        }
Beispiel #7
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 #8
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");
            }
        }
Beispiel #9
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 #10
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 #11
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document == null)
         throw new ArgumentNullException ("document");
     return SKIndexRemoveDocument (handle, document.Handle);
 }
Beispiel #12
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 #13
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 #14
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);
 }