Ejemplo n.º 1
0
        public ImapServerNamespace(ImapNamespace[] personalNamespaces, ImapNamespace[] otherUsersNamespaces, ImapNamespace[] sharedNamespaces)
        {
            if (personalNamespaces == null)
            throw new ArgumentNullException("personalNamespaces");
              if (otherUsersNamespaces == null)
            throw new ArgumentNullException("otherUsersNamespaces");
              if (sharedNamespaces == null)
            throw new ArgumentNullException("sharedNamespaces");

              this.personalNamespaces = personalNamespaces;
              this.otherUsersNamespaces = otherUsersNamespaces;
              this.sharedNamespaces = sharedNamespaces;
        }
        /// <summary>sends NAMESPACE command</summary>
        /// <remarks>valid in authenticated/selected state</remarks>
        public ImapCommandResult Namespace(out ImapNamespace namespaces)
        {
            RejectNonAuthenticatedState();

              namespaces = null;

              using (var t = new NamespaceTransaction(connection)) {
            if (ProcessTransaction(t).Succeeded) {
              this.namespaces = t.Result.Value;
              namespaces = t.Result.Value;
            }

            return t.Result;
              }
        }