コード例 #1
0
        public List <Uidl.Result> ExecuteUidl()
        {
            Uidl cm = new Uidl();
            List <Uidl.Result> l    = new List <Uidl.Result>();
            StringReader       sr   = null;
            String             s    = "";
            String             line = "";

            this.CheckAuthenticate();
            s  = this.Execute(cm);
            sr = new StringReader(s);
            while (sr.Peek() > -1)
            {
                line = sr.ReadLine();
                if (line == ".")
                {
                    break;
                }
                if (line.StartsWith("+OK", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    continue;
                }
                if (Uidl.Result.CheckFormat(line) == false)
                {
                    continue;
                }

                l.Add(new Uidl.Result(line));
            }
            return(l);
        }
コード例 #2
0
        public void ExecuteUidl(Action <List <Uidl.Result> > callbackFunction)
        {
            Uidl           cm = new Uidl();
            EndGetResponse md = null;

            md = new EndGetResponse(delegate(String responseString)
            {
                List <Uidl.Result> l = new List <Uidl.Result>();
                StringReader sr      = null;
                String line          = "";

                sr = new StringReader(responseString);
                while (sr.Peek() > -1)
                {
                    line = sr.ReadLine();
                    if (line == ".")
                    {
                        break;
                    }
                    if (line.StartsWith("+OK", StringComparison.InvariantCultureIgnoreCase) == true)
                    {
                        continue;
                    }
                    if (Uidl.Result.CheckFormat(line) == false)
                    {
                        continue;
                    }

                    l.Add(new Uidl.Result(line));
                }
                callbackFunction(l);
            });
            this.CheckAuthenticate();
            this.BeginExecute(cm, md);
        }
コード例 #3
0
        public void ExecuteUidl(Int64 mailIndex, Action <Uidl.Result[]> callbackFunction)
        {
            Uidl           cm = new Uidl(mailIndex);
            EndGetResponse md = null;

            md = new EndGetResponse(delegate(String responseString)
            {
                Uidl.Result[] rs = new Uidl.Result[1];
                rs[0]            = new Uidl.Result(responseString);
                callbackFunction(rs);
            });
            this.CheckAuthenticate();
            this.BeginExecute(cm, md);
        }
コード例 #4
0
        public Uidl.Result ExecuteUidl(Int64 mailIndex)
        {
            Uidl cm = new Uidl(mailIndex);

            Uidl.Result rs = null;
            String      s  = "";

            this.CheckAuthenticate();
            s = this.Execute(cm);
            if (Uidl.Result.CheckFormat(s) == true)
            {
                rs = new Uidl.Result(s);
            }
            return(rs);
        }