Exemplo n.º 1
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     return(SKIndexRemoveDocument(handle, document.Handle));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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);
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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");
        }
Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 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");
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 11
0
 public bool RemoveDocument(SKDocument document)
 {
     if (document == null)
         throw new ArgumentNullException ("document");
     return SKIndexRemoveDocument (handle, document.Handle);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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 ();
     }
 }
Exemplo n.º 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);
 }