Beispiel #1
0
        public string[] searchUIDs(string expr, string [] sub)
        {
            CamelException ex = new CamelException();
            Util.UIDArray uids = new Util.UIDArray(sub);
            IntPtr o = camel_folder_search_by_uids(cobject, expr, ref uids, ref ex);

            if (ex.id != 0)
                throw new Camel.Exception(ex);

            uids = new Util.UIDArray(o);
            camel_folder_search_free(cobject, o);

            return uids.uids;
        }
Beispiel #2
0
 static extern IntPtr camel_folder_get_message(IntPtr o, string uid, ref CamelException ex);
Beispiel #3
0
 public Exception(CamelException ex)
 {
     id = (Type)ex.id;
     desc = ex.desc;
 }
Beispiel #4
0
        public MimeMessage getMessage(string uid)
        {
            CamelException ex = new CamelException();
            IntPtr o = camel_folder_get_message(cobject, uid, ref ex);

            if (ex.id != 0)
                throw new Camel.Exception(ex);

            return (MimeMessage)fromCamel(o);
        }
Beispiel #5
0
        public URL(string uri)
        {
            CamelException ex = new CamelException();

            cobject = camel_url_new(uri, ref ex);
            if (ex.id != 0)
                throw new Exception(ex);
        }
Beispiel #6
0
 static extern IntPtr camel_url_new(string url, ref CamelException ex);
Beispiel #7
0
 static extern IntPtr camel_store_get_folder(IntPtr o, string name, int flags, ref CamelException ex);
Beispiel #8
0
        public Camel.Object getObject(int type)
        {
            IntPtr o;
            Camel.Object co;
            CamelException ex = new CamelException();

            o = camel_object_get_ptr(cobject, ref ex, type);
            if (ex.id != 0)
                throw new Camel.Exception(ex);

            co = fromCamel(o);
            camel_object_free(cobject, type, o);

            return co;
        }
Beispiel #9
0
        public Service getService(string uri, Provider.Type type)
        {
            IntPtr s;
            CamelException ex = new CamelException();

            s = camel_session_get_service(cobject, uri, (int)type, ref ex);
            if (ex.id != 0)
                throw new Camel.Exception(ex);

            return (Service)fromCamel(s);
        }
Beispiel #10
0
 static extern IntPtr camel_session_get_service_connected(IntPtr o, string uri, int type, ref CamelException ex);
Beispiel #11
0
 static extern IntPtr camel_object_get_ptr(IntPtr raw, ref CamelException ex, int tag);
Beispiel #12
0
 static extern int camel_object_get_int(IntPtr raw, ref CamelException ex, int tag);
Beispiel #13
0
        // maybe we want an indexer class to get properties?
        // e.g. name = folder.properties[Folder.Tag.NAME]
        public String getString(int type)
        {
            String s;
            IntPtr o;
            CamelException ex = new CamelException();

            o = camel_object_get_ptr(cobject, ref ex, type);
            if (ex.id != 0)
                throw new Camel.Exception(ex);

            s = Marshal.PtrToStringAuto(o);
            camel_object_free(cobject, type, o);

            return s;
        }
Beispiel #14
0
 static extern IntPtr camel_folder_search_by_expression(IntPtr o, string expr, ref CamelException ex);
Beispiel #15
0
        Folder getFolder(string name, int flags)
        {
            IntPtr s;
            CamelException ex = new CamelException();

            s = camel_store_get_folder(cobject, name, flags, ref ex);
            if (ex.id != 0)
                throw new Camel.Exception(ex);

            return (Folder)fromCamel(s);
        }
Beispiel #16
0
 static extern IntPtr camel_folder_search_by_uids(IntPtr o, string expr, ref Util.UIDArray uids, ref CamelException ex);
Beispiel #17
0
        public int getInt(int type)
        {
            int r;
            CamelException ex = new CamelException();

            r = camel_object_get_int(cobject, ref ex, type);
            if (ex.id != 0)
                throw new Camel.Exception(ex);

            return r;
        }