Пример #1
0
 public static void CalculateStringForEnabledUI(DataRow row, DataTable dataTable, DataObjectStore store)
 {
     if (store.GetValue("FederatedOrganizationIdentifier", "AccountNamespace") == null)
     {
         dataTable.Rows[0]["EnabledStringType"] = 0;
         return;
     }
     if (((SmtpDomain[])store.GetValue("PendingFederatedDomain", "PendingDomains")).Length > 0)
     {
         dataTable.Rows[0]["EnabledStringType"] = 1;
         return;
     }
     dataTable.Rows[0]["EnabledStringType"] = 2;
 }
Пример #2
0
        public static void GetDAGPostAction(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            IEnumerable <ADObjectId> enumerable  = (IEnumerable <ADObjectId>)store.GetValue("DatabaseAvailabilityGroup", "Servers");
            List <ServerResolverRow> list        = (enumerable != null) ? ServerResolver.Instance.ResolveObjects(enumerable).ToList <ServerResolverRow>() : null;
            IEnumerable <ADObjectId> enumerable2 = (IEnumerable <ADObjectId>)store.GetValue("DatabaseAvailabilityGroup", "OperationalServers");

            if (list != null && enumerable2 != null)
            {
                foreach (ADObjectId identity in enumerable2)
                {
                    Identity operationalServerIdentity = identity.ToIdentity();
                    list.ForEach(delegate(ServerResolverRow resolvedServer)
                    {
                        if (resolvedServer.Identity == operationalServerIdentity)
                        {
                            resolvedServer.OperationalState = Strings.Yes;
                        }
                    });
                }
            }
            dataTable.Rows[0]["ServersWithOperationalState"] = list;
            dataTable.Rows[0]["WitnessServer"]    = store.GetValue("DatabaseAvailabilityGroup", "WitnessServer");
            dataTable.Rows[0]["WitnessDirectory"] = store.GetValue("DatabaseAvailabilityGroup", "WitnessDirectory");
        }
Пример #3
0
        public static void AddToAllowList(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)dataTable.Rows[0]["ActiveSyncAllowedDeviceIDs"];

            multiValuedProperty.Add((string)store.GetValue("MobileDevice", "DeviceId"));
        }
Пример #4
0
        public static void OnPostGetObjectForNew(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];

            dataRow["UMDialPlan"] = (string)store.GetValue("UMDialPlan", "Name");
        }
Пример #5
0
 public static void SetIfFederatedPartialDisable(DataRow row, DataTable dataTable, DataObjectStore store)
 {
     if (store.GetDataObject("FederatedOrganizationIdentifier") != null && !(bool)store.GetValue("FederatedOrganizationIdentifier", "Enabled") && store.GetValue("FederatedOrganizationIdentifier", "AccountNamespace") != null)
     {
         dataTable.Rows[0]["FederationDisabled"]        = true;
         dataTable.Rows[0]["FederationPartialDisabled"] = true;
     }
 }
Пример #6
0
        public static void GenerateAddAndRemoveCollection(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            if (store.GetDataObject("FederatedOrganizationIdentifier") == null)
            {
                return;
            }
            List <object> list = new List <object>();

            if (dataTable.Rows[0]["SharingEnabledDomains"] != DBNull.Value)
            {
                foreach (object obj in ((IEnumerable)dataTable.Rows[0]["SharingEnabledDomains"]))
                {
                    SharingDomain sharingDomain = (SharingDomain)obj;
                    list.Add((SmtpDomain)sharingDomain);
                }
            }
            FederatedOrganizationIdWithDomainStatus federatedOrganizationIdWithDomainStatus = (FederatedOrganizationIdWithDomainStatus)store.GetDataObject("FederatedOrganizationIdentifier");
            SmtpDomain smtpDomain = (federatedOrganizationIdWithDomainStatus.AccountNamespace == null) ? null : new SmtpDomain(FederatedOrganizationId.RemoveHybridConfigurationWellKnownSubDomain(federatedOrganizationIdWithDomainStatus.AccountNamespace.Domain));

            if (smtpDomain == null && dataTable.Rows[0]["AccountNamespace"] != DBNull.Value)
            {
                smtpDomain = (SmtpDomain)((SharingDomain)dataTable.Rows[0]["AccountNamespace"]);
            }
            if (smtpDomain != null)
            {
                list.Remove(smtpDomain);
            }
            MultiValuedProperty <FederatedDomain> multiValuedProperty = (MultiValuedProperty <FederatedDomain>)store.GetValue("FederatedOrganizationIdentifier", "Domains");
            List <object> list2 = new List <object>();

            if (multiValuedProperty != null)
            {
                foreach (FederatedDomain federatedDomain in multiValuedProperty)
                {
                    if (!federatedDomain.Domain.Domain.Equals(smtpDomain.Domain, StringComparison.InvariantCultureIgnoreCase))
                    {
                        SmtpDomain item = new SmtpDomain(federatedDomain.Domain.Domain);
                        if (list.Contains(item))
                        {
                            list.Remove(item);
                        }
                        else
                        {
                            list2.Add(item);
                        }
                    }
                }
            }
            dataTable.Rows[0]["AddedSharingEnabledDomains"]   = list;
            dataTable.Rows[0]["RemovedSharingEnabledDomains"] = list2;
        }