C# Класс MailKit.Search.SearchQuery

A specialized query for searching messages in a IMailFolder.
A specialized query for searching messages in a IMailFolder.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
All SearchQuery
Answered SearchQuery
Deleted SearchQuery
Draft SearchQuery
Flagged SearchQuery
New SearchQuery
NotAnswered SearchQuery
NotDeleted SearchQuery
NotDraft SearchQuery
NotFlagged SearchQuery
NotRecent SearchQuery
NotSeen SearchQuery
Recent SearchQuery
Seen SearchQuery

Открытые методы

Метод Описание
And ( SearchQuery expr ) : BinarySearchQuery

Create a conditional AND operation.

A conditional AND operation only evaluates the second operand if the first operand evaluates to true.

And ( SearchQuery left, SearchQuery right ) : BinarySearchQuery

Create a conditional AND operation.

A conditional AND operation only evaluates the second operand if the first operand evaluates to true.

BccContains ( string text ) : TextSearchQuery

Match messages where the Bcc header contains the specified text.

Matches messages where the Bcc header contains the specified text.

BodyContains ( string text ) : TextSearchQuery

Match messages where the message body contains the specified text.

Matches messages where the message body contains the specified text.

CcContains ( string text ) : TextSearchQuery

Match messages where the Cc header contains the specified text.

Matches messages where the Cc header contains the specified text.

ChangedSince ( ulong modseq ) : SearchQuery

Match messages that have mod-sequence values greater than or equal to the specified mod-sequence value.

Matches messages that have mod-sequence values greater than or equal to the specified mod-sequence value.

DeliveredAfter ( System.DateTime date ) : DateSearchQuery

Match messages that were delivered after the specified date.

Matches messages that were delivered after the specified date.

DeliveredBefore ( System.DateTime date ) : DateSearchQuery

Match messages that were delivered before the specified date.

Matches messages that were delivered before the specified date.

DeliveredOn ( System.DateTime date ) : DateSearchQuery

Match messages that were delivered on the specified date.

Matches messages that were delivered on the specified date.

DoesNotHaveCustomFlag ( string flag ) : TextSearchQuery

Match messages that do not have the specified custom flag set.

Matches messages that do not have the specified custom flag set.

DoesNotHaveCustomFlags ( IEnumerable flags ) : SearchQuery

Match messages that do not have the specified custom flags set.

Matches messages that do not have the specified custom flags set.

DoesNotHaveFlags ( MessageFlags flags ) : SearchQuery

Match messages that do not have the specified flags set.

Matches messages that do not have the specified flags set.

Filter ( string name ) : SearchQuery

Match messages using a saved search filter.

Matches messages using a saved search filter.

FromContains ( string text ) : TextSearchQuery

Match messages where the From header contains the specified text.

Matches messages where the From header contains the specified text.

Fuzzy ( SearchQuery expr ) : UnarySearchQuery

Apply a fuzzy matching algorithm to the specified expression.

Applies a fuzzy matching algorithm to the specified expression.

This feature is not supported by all IMAP servers.
GMailMessageId ( ulong id ) : NumericSearchQuery

Match messages that have the specified GMail message identifier.

This search term can only be used with GMail.

GMailRawSearch ( string expression ) : TextSearchQuery

Match messages using the GMail search expression.

This search term can only be used with GMail.

GMailThreadId ( ulong thread ) : NumericSearchQuery

Match messages belonging to the specified GMail thread.

This search term can only be used with GMail.

HasCustomFlag ( string flag ) : TextSearchQuery

Match messages that have the specified custom flag set.

Matches messages that have the specified custom flag set.

HasCustomFlags ( IEnumerable flags ) : SearchQuery

Match messages that have the specified custom flags set.

Matches messages that have the specified custom flags set.

HasFlags ( MessageFlags flags ) : SearchQuery

Match messages that have the specified flags set.

Matches messages that have the specified flags set.

HasGMailLabel ( string label ) : TextSearchQuery

Match messages that have the specified GMail label.

This search term can only be used with GMail.

HeaderContains ( string field, string text ) : HeaderSearchQuery

Match messages where the specified header contains the specified text.

Matches messages where the specified header contains the specified text.

LargerThan ( int octets ) : NumericSearchQuery

Match messages that are larger than the specified number of octets.

Matches messages that are larger than the specified number of octets.

MessageContains ( string text ) : TextSearchQuery

Match messages where the raw message contains the specified text.

Matches messages where the raw message contains the specified text.

Not ( SearchQuery expr ) : UnarySearchQuery

Create a logical negation of the specified expression.

Creates a logical negation of the specified expression.

OlderThan ( int seconds ) : NumericSearchQuery

Match messages older than the specified number of seconds.

Matches messages older than the specified number of seconds.

Or ( SearchQuery expr ) : BinarySearchQuery

Create a conditional OR operation.

A conditional OR operation only evaluates the second operand if the first operand evaluates to true.

Or ( SearchQuery left, SearchQuery right ) : BinarySearchQuery

Create a conditional OR operation.

A conditional OR operation only evaluates the second operand if the first operand evaluates to false.

SearchQuery ( ) : System

Initializes a new instance of the T:MailKit.Search.SearchQuery class.

Creates a new SearchQuery that matches all messages.

SentAfter ( System.DateTime date ) : DateSearchQuery

Match messages that were sent after the specified date.

Matches messages that were sent after the specified date.

SentBefore ( System.DateTime date ) : DateSearchQuery

Match messages that were sent before the specified date.

Matches messages that were sent before the specified date.

SentOn ( System.DateTime date ) : DateSearchQuery

Match messages that were sent on the specified date.

Matches messages that were sent on the specified date.

SmallerThan ( int octets ) : NumericSearchQuery

Match messages that are smaller than the specified number of octets.

Matches messages that are smaller than the specified number of octets.

SubjectContains ( string text ) : TextSearchQuery

Match messages where the Subject header contains the specified text.

Matches messages where the Subject header contains the specified text.

ToContains ( string text ) : TextSearchQuery

Match messages where the To header contains the specified text.

Matches messages where the To header contains the specified text.

Uids ( IList uids ) : UidSearchQuery

Limit the search query to messages with the specified unique identifiers.

Limits the search query to messages with the specified unique identifiers.

YoungerThan ( int seconds ) : NumericSearchQuery

Match messages younger than the specified number of seconds.

Matches messages younger than the specified number of seconds.

Защищенные методы

Метод Описание
SearchQuery ( SearchTerm term ) : System

Initializes a new instance of the T:MailKit.Search.SearchQuery class.

Creates a new SearchQuery with the specified search term.

Приватные методы

Метод Описание
Header ( string field, string text ) : HeaderSearchQuery
Optimize ( ISearchQueryOptimizer optimizer ) : SearchQuery

Описание методов

And() публичный Метод

Create a conditional AND operation.
A conditional AND operation only evaluates the second operand if the first operand evaluates to true.
/// is null. ///
public And ( SearchQuery expr ) : BinarySearchQuery
expr SearchQuery An additional query to execute.
Результат BinarySearchQuery

And() публичный статический Метод

Create a conditional AND operation.
A conditional AND operation only evaluates the second operand if the first operand evaluates to true.
/// is null. /// -or- /// is null. ///
public static And ( SearchQuery left, SearchQuery right ) : BinarySearchQuery
left SearchQuery The first operand.
right SearchQuery The second operand.
Результат BinarySearchQuery

BccContains() публичный статический Метод

Match messages where the Bcc header contains the specified text.
Matches messages where the Bcc header contains the specified text.
/// is null. /// /// is empty. ///
public static BccContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

BodyContains() публичный статический Метод

Match messages where the message body contains the specified text.
Matches messages where the message body contains the specified text.
/// is null. /// /// is empty. ///
public static BodyContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

CcContains() публичный статический Метод

Match messages where the Cc header contains the specified text.
Matches messages where the Cc header contains the specified text.
/// is null. /// /// is empty. ///
public static CcContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

ChangedSince() публичный статический Метод

Match messages that have mod-sequence values greater than or equal to the specified mod-sequence value.
Matches messages that have mod-sequence values greater than or equal to the specified mod-sequence value.
public static ChangedSince ( ulong modseq ) : SearchQuery
modseq ulong The mod-sequence value.
Результат SearchQuery

DeliveredAfter() публичный статический Метод

Match messages that were delivered after the specified date.
Matches messages that were delivered after the specified date.
public static DeliveredAfter ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

DeliveredBefore() публичный статический Метод

Match messages that were delivered before the specified date.
Matches messages that were delivered before the specified date.
public static DeliveredBefore ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

DeliveredOn() публичный статический Метод

Match messages that were delivered on the specified date.
Matches messages that were delivered on the specified date.
public static DeliveredOn ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

DoesNotHaveCustomFlag() публичный статический Метод

Match messages that do not have the specified custom flag set.
Matches messages that do not have the specified custom flag set.
/// is null. /// /// is empty. ///
public static DoesNotHaveCustomFlag ( string flag ) : TextSearchQuery
flag string The custom flag.
Результат TextSearchQuery

DoesNotHaveCustomFlags() публичный статический Метод

Match messages that do not have the specified custom flags set.
Matches messages that do not have the specified custom flags set.
/// is null. /// /// One or more of the is null or empty. /// -or- /// No custom flags were given. ///
public static DoesNotHaveCustomFlags ( IEnumerable flags ) : SearchQuery
flags IEnumerable The custom flags.
Результат SearchQuery

DoesNotHaveFlags() публичный статический Метод

Match messages that do not have the specified flags set.
Matches messages that do not have the specified flags set.
/// does not contain any of the valie flag values. ///
public static DoesNotHaveFlags ( MessageFlags flags ) : SearchQuery
flags MessageFlags The message flags.
Результат SearchQuery

Filter() публичный статический Метод

Match messages using a saved search filter.
Matches messages using a saved search filter.
public static Filter ( string name ) : SearchQuery
name string The name of the saved search.
Результат SearchQuery

FromContains() публичный статический Метод

Match messages where the From header contains the specified text.
Matches messages where the From header contains the specified text.
/// is null. /// /// is empty. ///
public static FromContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

Fuzzy() публичный статический Метод

Apply a fuzzy matching algorithm to the specified expression.

Applies a fuzzy matching algorithm to the specified expression.

This feature is not supported by all IMAP servers.
/// is null. ///
public static Fuzzy ( SearchQuery expr ) : UnarySearchQuery
expr SearchQuery The expression
Результат UnarySearchQuery

GMailMessageId() публичный статический Метод

Match messages that have the specified GMail message identifier.
This search term can only be used with GMail.
public static GMailMessageId ( ulong id ) : NumericSearchQuery
id ulong The GMail message identifier.
Результат NumericSearchQuery

GMailRawSearch() публичный статический Метод

Match messages using the GMail search expression.
This search term can only be used with GMail.
/// is null. /// /// is empty. ///
public static GMailRawSearch ( string expression ) : TextSearchQuery
expression string The raw GMail search text.
Результат TextSearchQuery

GMailThreadId() публичный статический Метод

Match messages belonging to the specified GMail thread.
This search term can only be used with GMail.
public static GMailThreadId ( ulong thread ) : NumericSearchQuery
thread ulong The GMail thread.
Результат NumericSearchQuery

HasCustomFlag() публичный статический Метод

Match messages that have the specified custom flag set.
Matches messages that have the specified custom flag set.
/// is null. /// /// is empty. ///
public static HasCustomFlag ( string flag ) : TextSearchQuery
flag string The custom flag.
Результат TextSearchQuery

HasCustomFlags() публичный статический Метод

Match messages that have the specified custom flags set.
Matches messages that have the specified custom flags set.
/// is null. /// /// One or more of the is null or empty. /// -or- /// No custom flags were given. ///
public static HasCustomFlags ( IEnumerable flags ) : SearchQuery
flags IEnumerable The custom flags.
Результат SearchQuery

HasFlags() публичный статический Метод

Match messages that have the specified flags set.
Matches messages that have the specified flags set.
/// does not contain any of the valie flag values. ///
public static HasFlags ( MessageFlags flags ) : SearchQuery
flags MessageFlags The message flags.
Результат SearchQuery

HasGMailLabel() публичный статический Метод

Match messages that have the specified GMail label.
This search term can only be used with GMail.
/// is null. /// /// is empty. ///
public static HasGMailLabel ( string label ) : TextSearchQuery
label string The GMail label.
Результат TextSearchQuery

HeaderContains() публичный статический Метод

Match messages where the specified header contains the specified text.
Matches messages where the specified header contains the specified text.
/// is null. /// -or- /// is null. /// /// is empty. /// -or- /// is empty. ///
public static HeaderContains ( string field, string text ) : HeaderSearchQuery
field string The header field to match against.
text string The text to match against.
Результат HeaderSearchQuery

LargerThan() публичный статический Метод

Match messages that are larger than the specified number of octets.
Matches messages that are larger than the specified number of octets.
/// is a negative value. ///
public static LargerThan ( int octets ) : NumericSearchQuery
octets int The number of octets.
Результат NumericSearchQuery

MessageContains() публичный статический Метод

Match messages where the raw message contains the specified text.
Matches messages where the raw message contains the specified text.
/// is null. /// /// is empty. ///
public static MessageContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

Not() публичный статический Метод

Create a logical negation of the specified expression.
Creates a logical negation of the specified expression.
/// is null. ///
public static Not ( SearchQuery expr ) : UnarySearchQuery
expr SearchQuery The expression
Результат UnarySearchQuery

OlderThan() публичный статический Метод

Match messages older than the specified number of seconds.
Matches messages older than the specified number of seconds.
/// The number of seconds cannot be less than 1. ///
public static OlderThan ( int seconds ) : NumericSearchQuery
seconds int The number of seconds.
Результат NumericSearchQuery

Or() публичный Метод

Create a conditional OR operation.
A conditional OR operation only evaluates the second operand if the first operand evaluates to true.
/// is null. ///
public Or ( SearchQuery expr ) : BinarySearchQuery
expr SearchQuery An additional query to execute.
Результат BinarySearchQuery

Or() публичный статический Метод

Create a conditional OR operation.
A conditional OR operation only evaluates the second operand if the first operand evaluates to false.
/// is null. /// -or- /// is null. ///
public static Or ( SearchQuery left, SearchQuery right ) : BinarySearchQuery
left SearchQuery The first operand.
right SearchQuery The second operand.
Результат BinarySearchQuery

SearchQuery() публичный Метод

Initializes a new instance of the T:MailKit.Search.SearchQuery class.
Creates a new SearchQuery that matches all messages.
public SearchQuery ( ) : System
Результат System

SearchQuery() защищенный Метод

Initializes a new instance of the T:MailKit.Search.SearchQuery class.
Creates a new SearchQuery with the specified search term.
protected SearchQuery ( SearchTerm term ) : System
term SearchTerm The search term.
Результат System

SentAfter() публичный статический Метод

Match messages that were sent after the specified date.
Matches messages that were sent after the specified date.
public static SentAfter ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

SentBefore() публичный статический Метод

Match messages that were sent before the specified date.
Matches messages that were sent before the specified date.
public static SentBefore ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

SentOn() публичный статический Метод

Match messages that were sent on the specified date.
Matches messages that were sent on the specified date.
public static SentOn ( System.DateTime date ) : DateSearchQuery
date System.DateTime The date.
Результат DateSearchQuery

SmallerThan() публичный статический Метод

Match messages that are smaller than the specified number of octets.
Matches messages that are smaller than the specified number of octets.
/// is a negative value. ///
public static SmallerThan ( int octets ) : NumericSearchQuery
octets int The number of octets.
Результат NumericSearchQuery

SubjectContains() публичный статический Метод

Match messages where the Subject header contains the specified text.
Matches messages where the Subject header contains the specified text.
/// is null. /// /// is empty. ///
public static SubjectContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

ToContains() публичный статический Метод

Match messages where the To header contains the specified text.
Matches messages where the To header contains the specified text.
/// is null. /// /// is empty. ///
public static ToContains ( string text ) : TextSearchQuery
text string The text to match against.
Результат TextSearchQuery

Uids() публичный статический Метод

Limit the search query to messages with the specified unique identifiers.
Limits the search query to messages with the specified unique identifiers.
/// is null. /// /// is empty. ///
public static Uids ( IList uids ) : UidSearchQuery
uids IList The unique identifiers.
Результат UidSearchQuery

YoungerThan() публичный статический Метод

Match messages younger than the specified number of seconds.
Matches messages younger than the specified number of seconds.
/// The number of seconds cannot be less than 1. ///
public static YoungerThan ( int seconds ) : NumericSearchQuery
seconds int The number of seconds.
Результат NumericSearchQuery

Описание свойств

All публичное статическое свойство

Match all messages in the folder.
Matches all messages in the folder.
public static SearchQuery,MailKit.Search All
Результат SearchQuery

Answered публичное статическое свойство

Match messages with the MessageFlags.Answered flag set.
Matches messages with the MessageFlags.Answered flag set.
public static SearchQuery,MailKit.Search Answered
Результат SearchQuery

Deleted публичное статическое свойство

Match messages with the MessageFlags.Deleted flag set.
Matches messages with the MessageFlags.Deleted flag set.
public static SearchQuery,MailKit.Search Deleted
Результат SearchQuery

Draft публичное статическое свойство

Match messages with the MessageFlags.Draft flag set.
Matches messages with the MessageFlags.Draft flag set.
public static SearchQuery,MailKit.Search Draft
Результат SearchQuery

Flagged публичное статическое свойство

Match messages with the MessageFlags.Flagged flag set.
Matches messages with the MessageFlags.Flagged flag set.
public static SearchQuery,MailKit.Search Flagged
Результат SearchQuery

New публичное статическое свойство

Match messages with the MessageFlags.Recent flag set but not the MessageFlags.Seen.
Matches messages with the MessageFlags.Recent flag set but not the MessageFlags.Seen.
public static SearchQuery,MailKit.Search New
Результат SearchQuery

NotAnswered публичное статическое свойство

Match messages that do not have the MessageFlags.Answered flag set.
Matches messages that do not have the MessageFlags.Answered flag set.
public static SearchQuery,MailKit.Search NotAnswered
Результат SearchQuery

NotDeleted публичное статическое свойство

Match messages that do not have the MessageFlags.Deleted flag set.
Matches messages that do not have the MessageFlags.Deleted flag set.
public static SearchQuery,MailKit.Search NotDeleted
Результат SearchQuery

NotDraft публичное статическое свойство

Match messages that do not have the MessageFlags.Draft flag set.
Matches messages that do not have the MessageFlags.Draft flag set.
public static SearchQuery,MailKit.Search NotDraft
Результат SearchQuery

NotFlagged публичное статическое свойство

Match messages that do not have the MessageFlags.Flagged flag set.
Matches messages that do not have the MessageFlags.Flagged flag set.
public static SearchQuery,MailKit.Search NotFlagged
Результат SearchQuery

NotRecent публичное статическое свойство

Match messages that do not have the MessageFlags.Recent flag set.
Matches messages that do not have the MessageFlags.Recent flag set.
public static SearchQuery,MailKit.Search NotRecent
Результат SearchQuery

NotSeen публичное статическое свойство

Match messages that do not have the MessageFlags.Seen flag set.
Matches messages that do not have the MessageFlags.Seen flag set.
public static SearchQuery,MailKit.Search NotSeen
Результат SearchQuery

Recent публичное статическое свойство

Match messages with the MessageFlags.Recent flag set.
Matches messages with the MessageFlags.Recent flag set.
public static SearchQuery,MailKit.Search Recent
Результат SearchQuery

Seen публичное статическое свойство

Match messages with the MessageFlags.Seen flag set.
Matches messages with the MessageFlags.Seen flag set.
public static SearchQuery,MailKit.Search Seen
Результат SearchQuery