protected override void ValidateWrite(List <ValidationError> errors)
 {
     base.ValidateWrite(errors);
     if (this.CalendarItemRetrievalOption == CalendarItemRetrievalOptions.Custom && this.OwaServerUrl == null)
     {
         errors.Add(new PropertyValidationError(DirectoryStrings.ExArgumentNullException(PopImapAdConfigurationSchema.OwaServerUrl.Name), PopImapAdConfigurationSchema.OwaServerUrl, this.OwaServerUrl));
     }
     if (!string.IsNullOrEmpty(this.X509CertificateName) && !PopImapAdConfiguration.IsValidProtocolCertificate(this.X509CertificateName))
     {
         errors.Add(new PropertyValidationError(DirectoryStrings.InvalidCertificateName(this.X509CertificateName), PopImapAdConfigurationSchema.X509CertificateName, this.X509CertificateName));
     }
     if (!this.LogPerFileSizeQuota.IsUnlimited && this.LogPerFileSizeQuota.Value > ByteQuantifiedSize.Zero && this.LogPerFileSizeQuota.Value < ByteQuantifiedSize.FromMB(1UL))
     {
         errors.Add(new PropertyValidationError(DirectoryStrings.ExArgumentOutOfRangeException(PopImapAdConfigurationSchema.LogPerFileSizeQuota.Name, this.LogPerFileSizeQuota), PopImapAdConfigurationSchema.LogPerFileSizeQuota, this.LogPerFileSizeQuota));
     }
 }
        private static TResult FindOne <TResult>(ITopologyConfigurationSession session, Server server) where TResult : PopImapAdConfiguration, new()
        {
            TResult  tresult      = Activator.CreateInstance <TResult>();
            string   protocolName = tresult.ProtocolName;
            ObjectId rootId       = PopImapAdConfiguration.GetRootId(server, protocolName);

            if (rootId == null)
            {
                return(default(TResult));
            }
            TResult[] array = session.Find <TResult>(rootId as ADObjectId, QueryScope.OneLevel, null, null, 2);
            if (array == null || array.Length <= 0)
            {
                return(default(TResult));
            }
            return(array[0]);
        }
        internal static TResult FindOne <TResult>(ITopologyConfigurationSession session, string serverFqdn) where TResult : PopImapAdConfiguration, new()
        {
            Server server = session.FindServerByFqdn(serverFqdn);

            return(PopImapAdConfiguration.FindOne <TResult>(session, server));
        }
        internal static TResult FindOne <TResult>(ITopologyConfigurationSession session) where TResult : PopImapAdConfiguration, new()
        {
            Server server = session.FindLocalServer();

            return(PopImapAdConfiguration.FindOne <TResult>(session, server));
        }