Example #1
0
        /// <summary>
        /// Registers the untagged handler for the specified atom token.
        /// </summary>
        /// <param name="atom">The atom token.</param>
        /// <param name="handler">The handler.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <para><paramref name="atom"/> is <c>null</c>.</para>
        /// <para>-or-</para>
        /// <para><paramref name="handler"/> is <c>null</c>.</para>
        /// </exception>
        /// <exception cref="System.InvalidOperationException">
        /// Untagged handlers must be registered before the command has been queued.
        /// </exception>
        public void RegisterUntaggedHandler(string atom, ImapUntaggedHandler handler)
        {
            if (atom == null)
            {
                throw new ArgumentNullException(nameof(atom));
            }

            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            if (Status != ImapCommandStatus.Created)
            {
                throw new InvalidOperationException("Untagged handlers must be registered before the command has been queued.");
            }

            UntaggedHandlers.Add(atom, handler);
        }
Example #2
0
		/// <summary>
		/// Registers the untagged handler for the specified atom token.
		/// </summary>
		/// <param name="atom">The atom token.</param>
		/// <param name="handler">The handler.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="atom"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="handler"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.InvalidOperationException">
		/// Untagged handlers must be registered before the command has been queued.
		/// </exception>
		public void RegisterUntaggedHandler (string atom, ImapUntaggedHandler handler)
		{
			if (atom == null)
				throw new ArgumentNullException ("atom");

			if (handler == null)
				throw new ArgumentNullException ("handler");

			if (Status != ImapCommandStatus.Created)
				throw new InvalidOperationException ("Untagged handlers must be registered before the command has been queued.");

			UntaggedHandlers.Add (atom, handler);
		}
Example #3
0
        /// <summary>
        /// Registers the untagged handler for the specified atom token.
        /// </summary>
        /// <param name="atom">The atom token.</param>
        /// <param name="handler">The handler.</param>
        public void RegisterUntaggedHandler(string atom, ImapUntaggedHandler handler)
        {
            if (atom == null)
                throw new ArgumentNullException ("atom");

            if (handler == null)
                throw new ArgumentNullException ("handler");

            UntaggedHandlers.Add (atom, handler);
        }