/// <summary>sends SETQUOTA command</summary>
        /// <remarks>valid in authenticated/selected state (undocumented)</remarks>
        public ImapCommandResult SetQuota(string quotaRoot, ImapQuotaResource[] resourceLimits, out ImapQuota changedQuota)
        {
            if (quotaRoot == null)
            throw new ArgumentNullException("quotaRoot");
              if (resourceLimits == null)
            throw new ArgumentNullException("resourceLimits");

              var listOfResourceLimits = new List<ImapString>(resourceLimits.Length * 2);

              foreach (var resourceLimit in resourceLimits) {
            if (resourceLimit == null)
              throw new ArgumentException("contains null", "resourceLimits");

            listOfResourceLimits.Add(resourceLimit.Name);
            listOfResourceLimits.Add(resourceLimit.Limit.ToString());
              }

              RejectNonAuthenticatedState();

              changedQuota = null;

              using (var t = new SetQuotaTransaction(connection)) {
            // quota root
            t.RequestArguments["quota root"] = new ImapQuotedString(quotaRoot);
            // list of resource limits
            t.RequestArguments["list of resource limits"] = new ImapParenthesizedString(listOfResourceLimits.ToArray());

            if (ProcessTransaction(t).Succeeded)
              changedQuota = t.Result.Value;

            return t.Result;
              }
        }
 /// <summary>sends SETQUOTA command</summary>
 /// <remarks>valid in authenticated/selected state (undocumented)</remarks>
 public ImapCommandResult SetQuota(string quotaRoot, ImapQuotaResource resourceLimit, out ImapQuota changedQuota)
 {
     return SetQuota(quotaRoot, new[] {resourceLimit}, out changedQuota);
 }
        /// <summary>sends SETQUOTA command</summary>
        /// <remarks>valid in authenticated/selected state (undocumented)</remarks>
        public ImapCommandResult SetQuota(string quotaRoot, ImapQuotaResource[] resourceLimits)
        {
            ImapQuota discard;

              return SetQuota(quotaRoot, resourceLimits, out discard);
        }
        /// <summary>sends SETQUOTA command</summary>
        /// <remarks>valid in authenticated/selected state (undocumented)</remarks>
        public ImapCommandResult SetQuota(string quotaRoot, ImapQuotaResource resourceLimit)
        {
            ImapQuota discard;

              return SetQuota(quotaRoot, new[] {resourceLimit}, out discard);
        }