Esempio n. 1
0
        /// <summary>
        /// Processes IDLE command.
        /// </summary>
        /// <param name="cmdTag">Command tag.</param>
        /// <param name="argsText">Command arguments text.</param>
        /// <returns>Returns true if IDLE comand accepted, otherwise false.</returns>
        private bool Idle(string cmdTag, string argsText)
        {
            if (!IsAuthenticated)
            {
                WriteLine(string.Format("{0} NO Authenticate first !", cmdTag));
                return false;
            }
            if (SelectedMailbox.Length == 0 && m_StatusedMailbox.Length == 0)
            {
                WriteLine(string.Format("{0} BAD Select mailbox first !", cmdTag));
                return false;
            }
            if (m_pIDLE!=null)
            {
                m_pIDLE.Dispose();
            }
            m_pIDLE = new Command_IDLE(this, cmdTag, SelectedMailbox.Length == 0 ? m_StatusedMailbox : SelectedMailbox);

            return true;
        }
Esempio n. 2
0
        /// <summary>
        /// Processes IDLE command.
        /// </summary>
        /// <param name="cmdTag">Command tag.</param>
        /// <param name="argsText">Command arguments text.</param>
        /// <returns>Returns true if IDLE comand accepted, otherwise false.</returns>
        private bool Idle(string cmdTag,string argsText)
        {
            if(!this.Authenticated){
                this.Socket.WriteLine(cmdTag + " NO Authenticate first !");
                return false;
            }
            if(m_SelectedMailbox.Length == 0){
                this.Socket.WriteLine(cmdTag + " NO Select mailbox first !");
                return false;
            }

            m_pIDLE = new Command_IDLE(this,cmdTag);

            return true;
        }