Ejemplo n.º 1
0
 /// <summary>
 /// Joins two MailSearchCriteria objects into a new one using the specified logical operator.
 /// </summary>
 /// <param name="condition">The logical operator to use for joining the search conditions.
 /// Possible values are "OR", "NOT" and the empty string "" which denotes a logical AND.</param>
 /// <param name="left">The first MailSearchCriteria object</param>
 /// <param name="right">The second MailSearchCriteria object</param>
 /// <returns>A new MailSearchCriteria object representing the two search conditions joined by the
 /// specified logical operator.</returns>
 static MailSearchCriteria Join(string condition, MailSearchCriteria left, MailSearchCriteria right)
 {
     return(new MailSearchCriteria()
     {
         Operator = condition.ToUpper(), Criterias = new List <MailSearchCriteria> {
             left, right
         }
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Logically ORs multiple search conditions, meaning a message will be included in the search
 /// result if it meets at least either of the conditions.
 /// </summary>
 /// <param name="other">A search condition to logically OR this MailSearchCriteria instance
 /// with.</param>
 /// <returns>A new MailSearchCriteria instance which can be further chained with other search
 /// conditions.</returns>
 /// <exception cref="ArgumentNullException">The other parameter is null.</exception>
 public MailSearchCriteria Or(MailSearchCriteria other)
 {
     other.ThrowIfNull("other");
     return(Join("OR", this, other));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Logically ANDs multiple search conditions, meaning a message will only be included in the
 /// search result if both of the ANDed conditions are met.
 /// </summary>
 /// <param name="other">A search condition to logically AND this MailSearchCriteria instance
 /// with.</param>
 /// <returns>A new MailSearchCriteria instance which can be further chained with other search
 /// conditions.</returns>
 /// <exception cref="ArgumentNullException">The other parameter is null.</exception>
 public MailSearchCriteria And(MailSearchCriteria other)
 {
     other.ThrowIfNull("other");
     return(Join(string.Empty, this, other));
 }