Example #1
0
 public Command(CmdCb cb = null, bool isnull = false)
 {
     sb = new StringBuilder();
     if (isnull == false)
     {
         sb.AppendFormat("tag{0:d6} ", ++tag);
     }
     this.cb = cb;
 }
Example #2
0
        public FetchCommand(Fetch fetch, CmdCb cb, int?start = null, int?end = null) : base(cb)
        {
            if (start == null)
            {
                Append("fetch 1:* ");
            }
            else if (end == null)
            {
                Append("fetch {0}:* ", start);
            }
            else
            {
                Append("fetch {0}:{1} ", start, end);
            }
            switch (fetch)
            {
            case Fetch.Header:
                Append("body.peek[header]");
                break;

            case Fetch.Body:
                Append("body.peek[]");
                break;

            case Fetch.Text:
                Append("body.peek[text]");
                break;

            case Fetch.MessageID:
                Append("body.peek[header.fields (Message-ID)]");
                break;

            default:
                Append("body.peek[]");
                break;
            }
            Append("\r\n");
        }
Example #3
0
 public SelectCommand(String mailbox, CmdCb cb = null) : base(cb)
 {
     Append("select {0}\r\n", mailbox);
 }
Example #4
0
 public StatusCommand(String mailbox, CmdCb cb) : base(cb)
 {
     Append("status {0} (messages)\r\n", mailbox);
 }
Example #5
0
 public CapabilityCommand(CmdCb cb) : base(cb)
 {
     this.reqCapabilities = null;
     Append("capability\r\n");
 }
Example #6
0
 public ListCommand(CmdCb cb) : base(cb)
 {
     Append("list \"\" *\r\n");
 }