/// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="key">Search KEY.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>key</b> is null reference.</exception>
        public IMAP_Search_Key_Not(IMAP_Search_Key key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            m_pSearchKey = key;
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="key1">Search key1.</param>
        /// <param name="key2">Search key2.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>key1</b> or <b>key2</b> is null reference.</exception>
        public IMAP_Search_Key_Or(IMAP_Search_Key key1, IMAP_Search_Key key2)
        {
            if (key1 == null)
            {
                throw new ArgumentNullException("key1");
            }
            if (key2 == null)
            {
                throw new ArgumentNullException("key2");
            }

            m_pSearchKey1 = key1;
            m_pSearchKey2 = key2;
        }
Beispiel #3
0
        /// <summary>
        /// Returns parsed IMAP SEARCH <b>OR (search-key1) (search-key2)</b> key.
        /// </summary>
        /// <param name="r">String reader.</param>
        /// <returns>Returns parsed IMAP SEARCH <b>OR (search-key1) (search-key2)</b> key.</returns>
        /// <exception cref="ArgumentNullException">Is raised when <b>r</b> is null reference.</exception>
        /// <exception cref="ParseException">Is raised when parsing fails.</exception>
        internal static IMAP_Search_Key_Or Parse(StringReader r)
        {
            if (r == null)
            {
                throw new ArgumentNullException("r");
            }

            string word = r.ReadWord();

            if (!string.Equals(word, "OR", StringComparison.InvariantCultureIgnoreCase))
            {
                throw new ParseException("Parse error: Not a SEARCH 'OR' key.");
            }

            return(new IMAP_Search_Key_Or(IMAP_Search_Key.ParseKey(r), IMAP_Search_Key.ParseKey(r)));
        }
Beispiel #4
0
        /// <summary>
        /// Returns parsed IMAP SEARCH <b>AND</b> key group.
        /// </summary>
        /// <param name="r">String reader.</param>
        /// <returns>Returns parsed IMAP SEARCH <b>AND</b> key group.</returns>
        /// <exception cref="ArgumentNullException">Is raised when <b>r</b> is null reference.</exception>
        /// <exception cref="ParseException">Is raised when parsing fails.</exception>
        public static IMAP_Search_Key_Group Parse(StringReader r)
        {
            if (r == null)
            {
                throw new ArgumentNullException("r");
            }

            // Remove parenthesis, if any.
            if (r.StartsWith("("))
            {
                r = new StringReader(r.ReadParenthesized());
            }

            IMAP_Search_Key_Group retVal = new IMAP_Search_Key_Group();

            r.ReadToFirstChar();
            while (r.Available > 0)
            {
                retVal.m_pKeys.Add(IMAP_Search_Key.ParseKey(r));
            }

            return(retVal);
        }