C# Class MailKit.Net.Imap.ImapUtils

IMAP utility functions.
Afficher le fichier Open project: jstedfast/MailKit Class Usage Examples

Méthodes publiques

Méthode Description
CanonicalizeMailboxName ( string mailboxName, char directorySeparator ) : string

Canonicalize the name of the mailbox.

Canonicalizes the name of the mailbox by replacing various capitalizations of "INBOX" with the literal "INBOX" string.

FormatFlagsList ( MessageFlags flags, int numUserFlags ) : string

Formats a flags list suitable for use with the APPEND command.

FormatIndexSet ( IList indexes ) : string

Formats the array of indexes as a string suitable for use with IMAP commands.

FormatInternalDate ( DateTimeOffset date ) : string

Formats a date in a format suitable for use with the APPEND command.

FormatUidSet ( IList uids ) : string

Formats the array of UIDs as a string suitable for use with IMAP commands.

IsInbox ( string mailboxName ) : bool

Determines whether the specified mailbox is the Inbox.

ParseBody ( MailKit.Net.Imap.ImapEngine engine, string format, string path, CancellationToken cancellationToken ) : BodyPart
ParseEnvelope ( MailKit.Net.Imap.ImapEngine engine, CancellationToken cancellationToken ) : Envelope

Parses the ENVELOPE parenthesized list.

ParseFlagsList ( ImapEngine engine, string name, HashSet userFlags, CancellationToken cancellationToken ) : MessageFlags

Parses the flags list.

ParseFolderList ( ImapEngine engine, ImapCommand ic, int index ) : void

Parses an untagged LIST or LSUB response.

ParseImplementation ( ImapEngine engine, ImapCommand ic, int index ) : void

Parses an untagged ID response.

ParseInternalDate ( string text ) : DateTimeOffset

Parses the internal date string.

ParseLabelsList ( ImapEngine engine, CancellationToken cancellationToken ) : ReadOnlyCollection

Parses the X-GM-LABELS list.

ParseMetadata ( ImapEngine engine, ImapCommand ic, int index ) : void

Parses an untagged METADATA response.

ParseThreads ( ImapEngine engine, uint uidValidity, CancellationToken cancellationToken ) : IList

Parses the threads.

Private Methods

Méthode Description
InvalidInternalDateFormat ( string text ) : Exception
NeedsQuoting ( string value ) : bool
ParseContentDisposition ( MailKit.Net.Imap.ImapEngine engine, string format, CancellationToken cancellationToken ) : MimeKit.ContentDisposition
ParseContentLanguage ( MailKit.Net.Imap.ImapEngine engine, string format, CancellationToken cancellationToken ) : string[]
ParseContentLocation ( MailKit.Net.Imap.ImapEngine engine, string format, CancellationToken cancellationToken ) : Uri
ParseContentType ( MailKit.Net.Imap.ImapEngine engine, string format, CancellationToken cancellationToken, MimeKit.ContentType &contentType, string &value ) : bool
ParseEnvelopeAddress ( ImapEngine engine, string format, CancellationToken cancellationToken ) : EnvelopeAddress
ParseEnvelopeAddressList ( InternetAddressList list, ImapEngine engine, string format, CancellationToken cancellationToken ) : void
ParseEnvelopeDate ( ImapEngine engine, string format, CancellationToken cancellationToken ) : DateTimeOffset?
ParseMultipart ( ImapEngine engine, string format, string path, string subtype, CancellationToken cancellationToken ) : BodyPart
ParseParameterList ( StringBuilder builder, ImapEngine engine, string format, CancellationToken cancellationToken ) : void
ParseThread ( ImapEngine engine, uint uidValidity, CancellationToken cancellationToken ) : MessageThread
ReadNStringToken ( ImapEngine engine, string format, bool rfc2047, CancellationToken cancellationToken ) : string
ReadNumber ( ImapEngine engine, string format, CancellationToken cancellationToken ) : uint
ReadStringToken ( ImapEngine engine, string format, CancellationToken cancellationToken ) : string
SkipBodyExtensions ( ImapEngine engine, string format, CancellationToken cancellationToken ) : void
TryGetInt32 ( string text, int &index, char delim, int &value ) : bool
TryGetInt32 ( string text, int &index, int &value ) : bool
TryGetMonth ( string text, int &index, char delim, int &month ) : bool
TryGetTimeZone ( string text, int &index, TimeSpan &timezone ) : bool

Method Details

CanonicalizeMailboxName() public static méthode

Canonicalize the name of the mailbox.
Canonicalizes the name of the mailbox by replacing various capitalizations of "INBOX" with the literal "INBOX" string.
public static CanonicalizeMailboxName ( string mailboxName, char directorySeparator ) : string
mailboxName string The encoded mailbox name.
directorySeparator char The directory separator.
Résultat string

FormatFlagsList() public static méthode

Formats a flags list suitable for use with the APPEND command.
public static FormatFlagsList ( MessageFlags flags, int numUserFlags ) : string
flags MessageFlags The message flags.
numUserFlags int The number of user-defined flags.
Résultat string

FormatIndexSet() public static méthode

Formats the array of indexes as a string suitable for use with IMAP commands.
/// is null. /// /// One or more of the indexes has a negative value. ///
public static FormatIndexSet ( IList indexes ) : string
indexes IList The indexes.
Résultat string

FormatInternalDate() public static méthode

Formats a date in a format suitable for use with the APPEND command.
public static FormatInternalDate ( DateTimeOffset date ) : string
date DateTimeOffset The date.
Résultat string

FormatUidSet() public static méthode

Formats the array of UIDs as a string suitable for use with IMAP commands.
/// is null. /// /// One or more of the UIDs is invalid. ///
public static FormatUidSet ( IList uids ) : string
uids IList The UIDs.
Résultat string

IsInbox() public static méthode

Determines whether the specified mailbox is the Inbox.
public static IsInbox ( string mailboxName ) : bool
mailboxName string The mailbox name.
Résultat bool

ParseBody() public static méthode

public static ParseBody ( MailKit.Net.Imap.ImapEngine engine, string format, string path, CancellationToken cancellationToken ) : BodyPart
engine MailKit.Net.Imap.ImapEngine
format string
path string
cancellationToken System.Threading.CancellationToken
Résultat BodyPart

ParseEnvelope() public static méthode

Parses the ENVELOPE parenthesized list.
public static ParseEnvelope ( MailKit.Net.Imap.ImapEngine engine, CancellationToken cancellationToken ) : Envelope
engine MailKit.Net.Imap.ImapEngine The IMAP engine.
cancellationToken System.Threading.CancellationToken The cancellation token.
Résultat Envelope

ParseFlagsList() public static méthode

Parses the flags list.
public static ParseFlagsList ( ImapEngine engine, string name, HashSet userFlags, CancellationToken cancellationToken ) : MessageFlags
engine ImapEngine The IMAP engine.
name string The name of the flags being parsed.
userFlags HashSet A hash set of user-defined message flags that will be populated if non-null.
cancellationToken CancellationToken The cancellation token.
Résultat MessageFlags

ParseFolderList() public static méthode

Parses an untagged LIST or LSUB response.
public static ParseFolderList ( ImapEngine engine, ImapCommand ic, int index ) : void
engine ImapEngine The IMAP engine.
ic ImapCommand The IMAP command.
index int The index.
Résultat void

ParseImplementation() public static méthode

Parses an untagged ID response.
public static ParseImplementation ( ImapEngine engine, ImapCommand ic, int index ) : void
engine ImapEngine The IMAP engine.
ic ImapCommand The IMAP command.
index int The index.
Résultat void

ParseInternalDate() public static méthode

Parses the internal date string.
public static ParseInternalDate ( string text ) : DateTimeOffset
text string The text to parse.
Résultat DateTimeOffset

ParseLabelsList() public static méthode

Parses the X-GM-LABELS list.
public static ParseLabelsList ( ImapEngine engine, CancellationToken cancellationToken ) : ReadOnlyCollection
engine ImapEngine The IMAP engine.
cancellationToken CancellationToken The cancellation token.
Résultat ReadOnlyCollection

ParseMetadata() public static méthode

Parses an untagged METADATA response.
public static ParseMetadata ( ImapEngine engine, ImapCommand ic, int index ) : void
engine ImapEngine The IMAP engine.
ic ImapCommand The IMAP command.
index int The index.
Résultat void

ParseThreads() public static méthode

Parses the threads.
public static ParseThreads ( ImapEngine engine, uint uidValidity, CancellationToken cancellationToken ) : IList
engine ImapEngine The IMAP engine.
uidValidity uint The UIDVALIDITY of the folder.
cancellationToken CancellationToken The cancellation token.
Résultat IList