C# Class MailKit.MailStore

An abstract mail store implementation.
An abstract mail store implementation.
Inheritance: MailService, IMailStore
显示文件 Open project: jstedfast/MailKit

Public Methods

Method Description
EnableQuickResync ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Enable the quick resynchronization feature.

Enables quick resynchronization when a folder is opened using the MailFolder.Open(FolderAccess,uint,ulong,System.Collections.Generic.IList<UniqueId>,System.Threading.CancellationToken) method.

If this feature is enabled, the MailFolder.MessageExpunged event is replaced with the MailFolder.MessagesVanished event.

This method needs to be called immediately after calling one of the Authenticate methods, before opening any folders.

EnableQuickResyncAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously enable the quick resynchronization feature.

Enables quick resynchronization when a folder is opened using the MailFolder.Open(FolderAccess,uint,ulong,System.Collections.Generic.IList<UniqueId>,System.Threading.CancellationToken) method.

If this feature is enabled, the MailFolder.MessageExpunged event is replaced with the MailFolder.MessagesVanished event.

This method needs to be called immediately after calling one of the Authenticate methods, before opening any folders.

GetFolder ( FolderNamespace @namespace ) : IMailFolder

Get the folder for the specified namespace.

Gets the folder for the specified namespace.

GetFolder ( SpecialFolder folder ) : IMailFolder

Get the specified special folder.

Not all mail stores support special folders. Each implementation should provide a way to determine if special folders are supported.

GetFolder ( string path, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder

Get the folder for the specified path.

Gets the folder for the specified path.

GetFolderAsync ( string path, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously get the folder for the specified path.

Asynchronously gets the folder for the specified path.

GetFolders ( FolderNamespace @namespace, StatusItems items = StatusItems.None, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get all of the folders within the specified namespace.

Gets all of the folders within the specified namespace.

GetFolders ( FolderNamespace @namespace, bool subscribedOnly, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get all of the folders within the specified namespace.

Gets all of the folders within the specified namespace.

GetFoldersAsync ( FolderNamespace @namespace, StatusItems items = StatusItems.None, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Asynchronously get all of the folders within the specified namespace.

Asynchronously gets all of the folders within the specified namespace.

GetFoldersAsync ( FolderNamespace @namespace, bool subscribedOnly, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Asynchronously get all of the folders within the specified namespace.

Asynchronously gets all of the folders within the specified namespace.

GetMetadata ( IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection

Gets the specified metadata.

Gets the specified metadata.

GetMetadata ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection

Gets the specified metadata.

Gets the specified metadata.

GetMetadata ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : string

Gets the specified metadata.

Gets the specified metadata.

GetMetadataAsync ( IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously gets the specified metadata.

Asynchronously gets the specified metadata.

GetMetadataAsync ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously gets the specified metadata.

Asynchronously gets the specified metadata.

GetMetadataAsync ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously gets the specified metadata.

Asynchronously gets the specified metadata.

SetMetadata ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : void

Sets the specified metadata.

Sets the specified metadata.

SetMetadataAsync ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously sets the specified metadata.

Asynchronously sets the specified metadata.

Protected Methods

Method Description
MailStore ( IProtocolLogger protocolLogger ) : System

Initializes a new instance of the MailKit.MailStore class.

Initializes a new instance of the MailKit.MailStore class.

OnAlert ( string message ) : void

Raise the alert event.

Raises the alert event.

Method Details

EnableQuickResync() public abstract method

Enable the quick resynchronization feature.

Enables quick resynchronization when a folder is opened using the MailFolder.Open(FolderAccess,uint,ulong,System.Collections.Generic.IList<UniqueId>,System.Threading.CancellationToken) method.

If this feature is enabled, the MailFolder.MessageExpunged event is replaced with the MailFolder.MessagesVanished event.

This method needs to be called immediately after calling one of the Authenticate methods, before opening any folders.

/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Quick resynchronization needs to be enabled before selecting a folder. /// /// The mail store does not support quick resynchronization. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public abstract EnableQuickResync ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

EnableQuickResyncAsync() public method

Asynchronously enable the quick resynchronization feature.

Enables quick resynchronization when a folder is opened using the MailFolder.Open(FolderAccess,uint,ulong,System.Collections.Generic.IList<UniqueId>,System.Threading.CancellationToken) method.

If this feature is enabled, the MailFolder.MessageExpunged event is replaced with the MailFolder.MessagesVanished event.

This method needs to be called immediately after calling one of the Authenticate methods, before opening any folders.

/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Quick resynchronization needs to be enabled before selecting a folder. /// /// The mail store does not support quick resynchronization. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public EnableQuickResyncAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetFolder() public abstract method

Get the folder for the specified namespace.
Gets the folder for the specified namespace.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder could not be found. ///
public abstract GetFolder ( FolderNamespace @namespace ) : IMailFolder
@namespace FolderNamespace
return IMailFolder

GetFolder() public abstract method

Get the specified special folder.
Not all mail stores support special folders. Each implementation should provide a way to determine if special folders are supported.
/// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. ///
public abstract GetFolder ( SpecialFolder folder ) : IMailFolder
folder SpecialFolder The type of special folder.
return IMailFolder

GetFolder() public abstract method

Get the folder for the specified path.
Gets the folder for the specified path.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// The folder could not be found. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public abstract GetFolder ( string path, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder
path string The folder path.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IMailFolder

GetFolderAsync() public method

Asynchronously get the folder for the specified path.
Asynchronously gets the folder for the specified path.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// The folder could not be found. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public GetFolderAsync ( string path, CancellationToken cancellationToken = default(CancellationToken) ) : Task
path string The folder path.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetFolders() public abstract method

Get all of the folders within the specified namespace.
Gets all of the folders within the specified namespace.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public abstract GetFolders ( FolderNamespace @namespace, StatusItems items = StatusItems.None, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : IList
@namespace FolderNamespace
items StatusItems The status items to pre-populate.
subscribedOnly bool If set to true, only subscribed folders will be listed.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetFolders() public method

Get all of the folders within the specified namespace.
Gets all of the folders within the specified namespace.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public GetFolders ( FolderNamespace @namespace, bool subscribedOnly, CancellationToken cancellationToken = default(CancellationToken) ) : IList
@namespace FolderNamespace
subscribedOnly bool If set to true, only subscribed folders will be listed.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetFoldersAsync() public method

Asynchronously get all of the folders within the specified namespace.
Asynchronously gets all of the folders within the specified namespace.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public GetFoldersAsync ( FolderNamespace @namespace, StatusItems items = StatusItems.None, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
@namespace FolderNamespace
items StatusItems The status items to pre-populate.
subscribedOnly bool If set to true, only subscribed folders will be listed.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetFoldersAsync() public method

Asynchronously get all of the folders within the specified namespace.
Asynchronously gets all of the folders within the specified namespace.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A protocol error occurred. /// /// The command failed. ///
public GetFoldersAsync ( FolderNamespace @namespace, bool subscribedOnly, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
@namespace FolderNamespace
subscribedOnly bool If set to true, only subscribed folders will be listed.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetMetadata() public method

Gets the specified metadata.
Gets the specified metadata.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetMetadata ( IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection
tags IEnumerable The metadata tags.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MetadataCollection

GetMetadata() public abstract method

Gets the specified metadata.
Gets the specified metadata.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public abstract GetMetadata ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection
options MetadataOptions The metadata options.
tags IEnumerable The metadata tags.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MetadataCollection

GetMetadata() public abstract method

Gets the specified metadata.
Gets the specified metadata.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public abstract GetMetadata ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : string
tag MetadataTag The metadata tag.
cancellationToken System.Threading.CancellationToken The cancellation token.
return string

GetMetadataAsync() public method

Asynchronously gets the specified metadata.
Asynchronously gets the specified metadata.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetMetadataAsync ( IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : Task
tags IEnumerable The metadata tags.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetMetadataAsync() public method

Asynchronously gets the specified metadata.
Asynchronously gets the specified metadata.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetMetadataAsync ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : Task
options MetadataOptions The metadata options.
tags IEnumerable The metadata tags.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetMetadataAsync() public method

Asynchronously gets the specified metadata.
Asynchronously gets the specified metadata.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetMetadataAsync ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : Task
tag MetadataTag The metadata tag.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

MailStore() protected method

Initializes a new instance of the MailKit.MailStore class.
Initializes a new instance of the MailKit.MailStore class.
/// is null. ///
protected MailStore ( IProtocolLogger protocolLogger ) : System
protocolLogger IProtocolLogger The protocol logger.
return System

OnAlert() protected method

Raise the alert event.
Raises the alert event.
/// is null. ///
protected OnAlert ( string message ) : void
message string The alert message.
return void

SetMetadata() public abstract method

Sets the specified metadata.
Sets the specified metadata.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public abstract SetMetadata ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : void
metadata MetadataCollection The metadata.
cancellationToken CancellationToken The cancellation token.
return void

SetMetadataAsync() public method

Asynchronously sets the specified metadata.
Asynchronously sets the specified metadata.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder does not support metadata. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public SetMetadataAsync ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : Task
metadata MetadataCollection The metadata.
cancellationToken CancellationToken The cancellation token.
return Task