/// <summary> /// Returns parsed IMAP SEARCH <b>UID (sequence set)</b> key. /// </summary> /// <param name="r">String reader.</param> /// <returns>Returns parsed IMAP SEARCH <b>UID (sequence set)</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_Uid Parse(StringReader r) { if (r == null) { throw new ArgumentNullException("r"); } string word = r.ReadWord(); if (!string.Equals(word, "UID", Helpers.GetDefaultIgnoreCaseComparison())) { throw new ParseException("Parse error: Not a SEARCH 'UID' key."); } r.ReadToFirstChar(); string value = r.QuotedReadToDelimiter(' '); if (value == null) { throw new ParseException("Parse error: Invalid 'UID' value."); } try{ return(new IMAP_Search_Key_Uid(IMAP_t_SeqSet.Parse(value))); } catch { throw new ParseException("Parse error: Invalid 'UID' value."); } }
/// <summary> /// Parses COPYUID optional response from reader. /// </summary> /// <param name="r">COPYUID optional response reader.</param> /// <returns>Returns COPYUID optional response.</returns> /// <exception cref="ArgumentNullException">Is raised when <b>r</b> is null reference.</exception> public new static IMAP_t_orc_CopyUid Parse(StringReader r) { if (r == null) { throw new ArgumentNullException("r"); } /* RFC 4315 3. * COPYUID * Followed by the UIDVALIDITY of the destination mailbox, a UID set * containing the UIDs of the message(s) in the source mailbox that * were copied to the destination mailbox and containing the UIDs * assigned to the copied message(s) in the destination mailbox, * indicates that the message(s) have been copied to the destination * mailbox with the stated UID(s). */ string[] code_mailboxUid_sourceSeqSet_targetSeqSet = r.ReadParenthesized().Split(new char[] { ' ' }, 4); if (!string.Equals("COPYUID", code_mailboxUid_sourceSeqSet_targetSeqSet[0], StringComparison.InvariantCultureIgnoreCase)) { throw new ArgumentException("Invalid COPYUID response value.", "r"); } if (code_mailboxUid_sourceSeqSet_targetSeqSet.Length != 4) { throw new ArgumentException("Invalid COPYUID response value.", "r"); } return(new IMAP_t_orc_CopyUid( Convert.ToInt64(code_mailboxUid_sourceSeqSet_targetSeqSet[1]), IMAP_t_SeqSet.Parse(code_mailboxUid_sourceSeqSet_targetSeqSet[2]), IMAP_t_SeqSet.Parse(code_mailboxUid_sourceSeqSet_targetSeqSet[3]) )); }
public IMAP_Search_Key_Uid(IMAP_SequenceSet seqSet) { if (seqSet == null) { throw new ArgumentNullException("seqSet"); } m_pSeqSet = IMAP_t_SeqSet.Parse(seqSet.ToSequenceSetString()); }
/// <summary> /// Returns parsed IMAP SEARCH <b>sequence-set</b> key. /// </summary> /// <param name="r">String reader.</param> /// <returns>Returns parsed IMAP SEARCH <b>sequence-set</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_SeqSet Parse(StringReader r) { if (r == null) { throw new ArgumentNullException("r"); } r.ReadToFirstChar(); string value = r.QuotedReadToDelimiter(' '); if (value == null) { throw new ParseException("Parse error: Invalid 'sequence-set' value."); } try{ return(new IMAP_Search_Key_SeqSet(IMAP_t_SeqSet.Parse(value))); } catch { throw new ParseException("Parse error: Invalid 'sequence-set' value."); } }