예제 #1
0
        /// <summary>
        /// Send IDLE command to IMAP server.
        /// You can receive message from server by register event handler to MessageReceived event of ImapIdleCommand object
        /// </summary>
        /// <returns></returns>
        public void ExecuteIdle(ImapIdleCommand command)
        {
            this.ValidateState(ImapConnectionState.Authenticated);
            this.Send(this.Tag + " IDLE");
            var bb = command.GetByteArray();

            command.IAsyncResult = this.Stream.BeginRead(bb, 0, bb.Length, this.ExecuteIdleCallback, command);
            this._State          = ImapConnectionState.Idle;
        }
예제 #2
0
        /// <summary>
        /// Send done command to IMAP server.
        /// </summary>
        /// <returns></returns>
        public ImapCommandResult ExecuteDone(ImapIdleCommand command)
        {
            this.ValidateState(ImapConnectionState.Idle);
            if (command.IAsyncResult != null)
            {
                var x = this.Stream.EndRead(command.IAsyncResult);
            }
            String s = this.Execute("DONE");

            this._State = ImapConnectionState.Authenticated;

            return(new ImapCommandResult(this.Tag, s));
        }
예제 #3
0
 /// <summary>
 /// Send IDLE command to IMAP server.
 /// You can receive message from server by register event handler to MessageReceived event of ImapIdleCommand object
 /// </summary>
 /// <returns></returns>
 public void ExecuteIdle(ImapIdleCommand command)
 {
     this.ValidateState(ImapConnectionState.Authenticated);
     this.Send(this.Tag + " IDLE");
     var bb = command.Buffer;
     command.IAsyncResult = this.Stream.BeginRead(bb, 0, bb.Length, this.ExecuteIdleCallback, command);
     this._State = ImapConnectionState.Idle;
 }
예제 #4
0
 /// <summary>
 /// Send done command to IMAP server.
 /// </summary>
 /// <returns></returns>
 public ImapCommandResult ExecuteDone(ImapIdleCommand command)
 {
     this.ValidateState(ImapConnectionState.Idle);
     if (command.IAsyncResult != null)
     {
         var x = this.Stream.EndRead(command.IAsyncResult);
     }
     var rs = this.Execute("DONE");
     this._State = ImapConnectionState.Authenticated;
     return rs;
 }