Esempio n. 1
0
        public ImapCommandResult(String tag, String text)                                                                   //Laiko informacija apie atsakyma (ar geras ar ne)
        {
            this._Text = text;                                                                                              //+
            var    rx       = new Regex(@"^" + tag + " (OK|NO|BAD) .*$", RegexOptions.IgnoreCase | RegexOptions.Multiline); //+
            Match  m        = rx.Match(text);                                                                               //+
            String response = m.Groups[1].Value;                                                                            //+

            if (String.Equals(response, "OK", StringComparison.OrdinalIgnoreCase) == true)                                  //+
            {
                this._Status = ImapCommandResultStatus.Ok;                                                                  //+
            }
            else if (String.Equals(response, "NO", StringComparison.OrdinalIgnoreCase) == true)                             //+
            {
                this._Status = ImapCommandResultStatus.No;                                                                  //+
            }
            else if (String.Equals(response, "BAD", StringComparison.OrdinalIgnoreCase) == true)                            //+
            {
                this._Status = ImapCommandResultStatus.Bad;                                                                 //+
            }
            else
            {
                this._Status = ImapCommandResultStatus.None; //+
            }
            this._Text = text;                               //+
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="text"></param>
        public ImapCommandResult(String tag, String text)
        {
            this._Text = text;
            var    rx       = new Regex(@"^" + tag + " (OK|NO|BAD) .*$", RegexOptions.IgnoreCase | RegexOptions.Multiline);
            Match  m        = rx.Match(text);
            String response = m.Groups[1].Value;

            if (String.Equals(response, "OK", StringComparison.OrdinalIgnoreCase) == true)
            {
                this._Status = ImapCommandResultStatus.Ok;
            }
            else if (String.Equals(response, "NO", StringComparison.OrdinalIgnoreCase) == true)
            {
                this._Status = ImapCommandResultStatus.No;
            }
            else if (String.Equals(response, "BAD", StringComparison.OrdinalIgnoreCase) == true)
            {
                this._Status = ImapCommandResultStatus.Bad;
            }
            else
            {
                this._Status = ImapCommandResultStatus.None;
            }
            this._Text = text;
        }
Esempio n. 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="text"></param>
 public ImapCommandResult(String tag, String text)
 {
     this._Text = text;
     var rx = new Regex(@"^" + tag + " (OK|NO|BAD) .*$", RegexOptions.IgnoreCase | RegexOptions.Multiline);
     Match m = rx.Match(text);
     String response = m.Groups[1].Value;
     if (String.Equals(response, "OK", StringComparison.OrdinalIgnoreCase) == true)
     {
         this._Status = ImapCommandResultStatus.Ok;
     }
     else if (String.Equals(response, "NO", StringComparison.OrdinalIgnoreCase) == true)
     {
         this._Status = ImapCommandResultStatus.No;
     }
     else if (String.Equals(response, "BAD", StringComparison.OrdinalIgnoreCase) == true)
     {
         this._Status = ImapCommandResultStatus.Bad;
     }
     else
     {
         this._Status = ImapCommandResultStatus.None;
     }
     this._Text = text;
 }