当前位置: 首页>>代码示例>>C#>>正文


C# ImapEngine.DecodeMailboxName方法代码示例

本文整理汇总了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;
		}
开发者ID:Gekctek,项目名称:MailKit,代码行数:16,代码来源:ImapFolderConstructorArgs.cs

示例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;
            };
        }
开发者ID:rajeshwarn,项目名称:MailKit,代码行数:20,代码来源:ImapFolder.cs

示例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);
		}
开发者ID:BehnamEmamian,项目名称:MailKit,代码行数:37,代码来源:ImapUtils.cs

示例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);
        }
开发者ID:rajeshwarn,项目名称:MailKit,代码行数:30,代码来源:ImapUtils.cs


注:本文中的MailKit.Net.Imap.ImapEngine.DecodeMailboxName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。