本文整理汇总了C#中MailKit.Net.Imap.ImapEngine.DecodeMailboxName方法的典型用法代码示例。如果您正苦于以下问题:C# ImapEngine.DecodeMailboxName方法的具体用法?C# ImapEngine.DecodeMailboxName怎么用?C# ImapEngine.DecodeMailboxName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailKit.Net.Imap.ImapEngine
的用法示例。
在下文中一共展示了ImapEngine.DecodeMailboxName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImapFolderConstructorArgs
/// <summary>
/// Initializes a new instance of the <see cref="MailKit.Net.Imap.ImapFolderConstructorArgs"/> class.
/// </summary>
/// <param name="engine">The IMAP command engine.</param>
/// <param name="encodedName">The encoded name.</param>
/// <param name="attributes">The attributes.</param>
/// <param name="delim">The directory separator.</param>
internal ImapFolderConstructorArgs (ImapEngine engine, string encodedName, FolderAttributes attributes, char delim)
{
FullName = engine.DecodeMailboxName (encodedName);
Name = GetBaseName (FullName, delim);
DirectorySeparator = delim;
EncodedName = encodedName;
Attributes = attributes;
Engine = engine;
}
示例2: ImapFolder
/// <summary>
/// Initializes a new instance of the <see cref="MailKit.Net.Imap.ImapFolder"/> class.
/// </summary>
/// <param name="engine">The IMAP engine.</param>
/// <param name="encodedName">The encoded name.</param>
/// <param name="attrs">The folder attributes.</param>
/// <param name="delim">The path delimeter.</param>
internal ImapFolder(ImapEngine engine, string encodedName, FolderAttributes attrs, char delim)
{
FullName = engine.DecodeMailboxName (encodedName);
Name = GetBaseName (FullName, delim);
DirectorySeparator = delim;
EncodedName = encodedName;
Attributes = attrs;
Engine = engine;
engine.Disconnected += (sender, e) => {
Access = FolderAccess.None;
};
}
示例3: ParseLabelsList
/// <summary>
/// Parses the X-GM-LABELS list.
/// </summary>
/// <returns>The message labels.</returns>
/// <param name="engine">The IMAP engine.</param>
/// <param name="cancellationToken">The cancellation token.</param>
public static ReadOnlyCollection<string> ParseLabelsList (ImapEngine engine, CancellationToken cancellationToken)
{
var token = engine.ReadToken (cancellationToken);
var labels = new List<string> ();
if (token.Type != ImapTokenType.OpenParen)
throw ImapEngine.UnexpectedToken (token, false);
// Note: GMail's IMAP implementation is broken and does not quote strings with ']' like it should.
token = engine.ReadToken (ImapStream.GMailLabelSpecials, cancellationToken);
while (token.Type == ImapTokenType.Flag || token.Type == ImapTokenType.Atom || token.Type == ImapTokenType.QString || token.Type == ImapTokenType.Nil) {
// Apparently it's possible to set a NIL label in GMail...
//
// See https://github.com/jstedfast/MailKit/issues/244 for an example.
if (token.Type != ImapTokenType.Nil) {
var label = engine.DecodeMailboxName ((string) token.Value);
labels.Add (label);
} else {
labels.Add (null);
}
token = engine.ReadToken (ImapStream.GMailLabelSpecials, cancellationToken);
}
if (token.Type != ImapTokenType.CloseParen)
throw ImapEngine.UnexpectedToken (token, false);
return new ReadOnlyCollection<string> (labels);
}
示例4: ParseLabelsList
/// <summary>
/// Parses the X-GM-LABELS list.
/// </summary>
/// <returns>The message labels.</returns>
/// <param name="engine">The IMAP engine.</param>
/// <param name="cancellationToken">The cancellation token.</param>
public static ReadOnlyCollection<string> ParseLabelsList(ImapEngine engine, CancellationToken cancellationToken)
{
var token = engine.ReadToken (cancellationToken);
var labels = new List<string> ();
if (token.Type != ImapTokenType.OpenParen)
throw ImapEngine.UnexpectedToken (token, false);
// Note: GMail's IMAP implementation is broken and does not quote strings with ']' like it should.
token = engine.ReadToken (ImapStream.GMailLabelSpecials, cancellationToken);
while (token.Type == ImapTokenType.Flag || token.Type == ImapTokenType.Atom || token.Type == ImapTokenType.QString) {
var label = engine.DecodeMailboxName ((string) token.Value);
labels.Add (label);
token = engine.ReadToken (cancellationToken);
}
if (token.Type != ImapTokenType.CloseParen)
throw ImapEngine.UnexpectedToken (token, false);
return new ReadOnlyCollection<string> (labels);
}