Пример #1
0
        private static ReadOnlyCollection <cNamespace> ZToNameSpaceCollection(cIMAPClient pClient, IList <cNamespaceName> pNames)
        {
            if (pNames == null)
            {
                return(null);
            }
            List <cNamespace> lNamespaces = new List <cNamespace>();

            foreach (var lName in pNames)
            {
                lNamespaces.Add(new cNamespace(pClient, lName));
            }
            return(lNamespaces.AsReadOnly());
        }
Пример #2
0
        internal cNamespaces(cIMAPClient pClient, IList <cNamespaceName> pPersonal, IList <cNamespaceName> pOtherUsers, IList <cNamespaceName> pShared)
        {
            if (pPersonal != null && pPersonal.Count == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(pPersonal));
            }
            if (pOtherUsers != null && pOtherUsers.Count == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(pOtherUsers));
            }
            if (pShared != null && pShared.Count == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(pShared));
            }

            Personal   = ZToNameSpaceCollection(pClient, pPersonal);
            OtherUsers = ZToNameSpaceCollection(pClient, pOtherUsers);
            Shared     = ZToNameSpaceCollection(pClient, pShared);
        }
Пример #3
0
 internal cNamespace(cIMAPClient pClient, cNamespaceName pNamespaceName)
 {
     Client        = pClient ?? throw new ArgumentNullException(nameof(pClient));
     NamespaceName = pNamespaceName ?? throw new ArgumentNullException(nameof(pNamespaceName));
 }
Пример #4
0
        // re-instate if threading is ever done
        //public readonly int Indent; // Indicates the indent of the message. This only means something when compared to the indents of surrounding items in a threaded list of messages. It is a bit of a hack having it in this class.

        internal cMessage(cIMAPClient pClient, iMessageHandle pMessageHandle) // , int pIndent = -1 // re-instate if threading is ever done
        {
            Client        = pClient ?? throw new ArgumentNullException(nameof(pClient));
            MessageHandle = pMessageHandle ?? throw new ArgumentNullException(nameof(pMessageHandle));
            //Indent = pIndent; // re-instate if threading is ever done
        }
Пример #5
0
 internal cAttachment(cIMAPClient pClient, iMessageHandle pMessageHandle, cSinglePartBody pPart)
 {
     Client        = pClient ?? throw new ArgumentNullException(nameof(pClient));
     MessageHandle = pMessageHandle ?? throw new ArgumentNullException(nameof(pMessageHandle));
     Part          = pPart ?? throw new ArgumentNullException(nameof(pPart));
 }