protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            this.CheckForDuplicateExistingDomain();
            AcceptedDomain acceptedDomain = new AcceptedDomain();

            acceptedDomain.Name       = this.Name;
            acceptedDomain.DomainName = new SmtpDomainWithSubdomains(this.DomainName, false);
            acceptedDomain.DomainType = this.DomainType;
            acceptedDomain.SetId(base.Session, this.DomainName.ToString());
            acceptedDomain.OrganizationId = base.CurrentOrganizationId;
            NewAcceptedDomain.ValidateDomainName(acceptedDomain, new Task.TaskErrorLoggingDelegate(this.WriteWrappedError));
            if (!this.DomainOwnershipVerified && this.AuthenticationType == AuthenticationType.Federated)
            {
                bool flag = false;
                AcceptedDomainIdParameter    acceptedDomainIdParameter = AcceptedDomainIdParameter.Parse("*");
                IEnumerable <AcceptedDomain> objects = acceptedDomainIdParameter.GetObjects <AcceptedDomain>(this.TenantCU.Id, base.Session);
                foreach (AcceptedDomain acceptedDomain2 in objects)
                {
                    SmtpDomainWithSubdomains smtpDomainWithSubdomains = new SmtpDomainWithSubdomains(acceptedDomain2.DomainName.Domain.ToString(), true);
                    if (smtpDomainWithSubdomains.Match(this.DomainName.ToString()) == acceptedDomain2.DomainName.Domain.Length)
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    base.WriteError(new OrganizationTaskException(Strings.ErrorTenantAdminsCanOnlyAddSubdomains(this.DomainName.ToString())), ErrorCategory.InvalidOperation, null);
                }
            }
            TaskLogger.LogExit();
        }