private static void LoadRestrictIOCToSP1OrGreater(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            string text  = "true";
            string text2 = "false";

            try
            {
                text = ConfigurationManager.AppSettings["RestrictIOCToSP1OrGreater0"];
                if (string.IsNullOrEmpty(text))
                {
                    text = "true";
                }
                text2 = ConfigurationManager.AppSettings["RestrictIOCToSP1OrGreater1"];
                if (string.IsNullOrEmpty(text2))
                {
                    text2 = "false";
                }
            }
            catch (UriFormatException ex)
            {
                logError("RestrictIOCToSP1OrGreaterWorldWide", ex.ToString());
            }
            addValue("RestrictIOCToSP1OrGreaterWorldWide", !string.Equals(text, "false"));
            addValue("RestrictIOCToSP1OrGreaterGallatin", !string.Equals(text2, "false"));
        }
        private static void LoadDCIsDirSyncRunning(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            OrganizationId        organizationId = RbacPrincipal.Current.RbacConfiguration.OrganizationId;
            IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(organizationId), 668, "LoadDCIsDirSyncRunning", "f:\\15.00.1497\\sources\\dev\\admin\\src\\ecp\\Organization\\OrganizationCache.cs");
            ADRawEntry            adrawEntry = tenantOrTopologyConfigurationSession.ReadADRawEntry(organizationId.ConfigurationUnit, new PropertyDefinition[]
            {
                OrganizationSchema.IsDirSyncRunning
            });
            bool flag = adrawEntry != null && (bool)adrawEntry[OrganizationSchema.IsDirSyncRunning];

            addValue("DCIsDirSyncRunning", flag);
        }
        private static void LoadCrossPremiseServiceInstance(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            string value = string.Empty;

            try
            {
                WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=HybridConfigurationWizardService&workflow=GetServiceInstance");
                PowerShellResults <JsonDictionary <object> > powerShellResults = (PowerShellResults <JsonDictionary <object> >)webServiceReference.GetObject(null);
                if (powerShellResults.Output.Length > 0)
                {
                    value = (string)powerShellResults.Output[0].RawDictionary["ServiceInstance"];
                }
            }
            catch (Exception ex)
            {
                logError("ServiceInstance", ex.ToString());
            }
            addValue("ServiceInstance", value);
        }
        private static void LoadCrossPremiseUrl(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            string value  = string.Empty;
            string text   = string.Empty;
            string text2  = string.Empty;
            string value2 = string.Empty;
            string text3  = string.Empty;
            string text4  = string.Empty;

            try
            {
                string text5 = ConfigurationManager.AppSettings["HybridServerUrl0"] ?? "https://outlook.office365.com/ecp/";
                string text6 = ConfigurationManager.AppSettings["HybridServerUrl1"] ?? "https://partner.outlook.cn/ecp/";
                text  = new Uri(text5).Host;
                text3 = string.Format("{0}hybrid.aspx?xprs={{0}}&xprf={{1}}&xprv={1}&realm={{2}}&exsvurl=1", text5, Util.ApplicationVersion);
                text2 = new Uri(text6).Host;
                text4 = string.Format("{0}hybrid.aspx?xprs={{0}}&xprf={{1}}&xprv={1}&realm={{2}}&exsvurl=1", text6, Util.ApplicationVersion);
            }
            catch (UriFormatException ex)
            {
                logError("CrossPremiseServer", ex.ToString());
            }
            string serviceInstance;

            if ((serviceInstance = OrganizationCache.ServiceInstance) != null)
            {
                if (!(serviceInstance == "0"))
                {
                    if (serviceInstance == "1")
                    {
                        value  = text2;
                        value2 = text4;
                    }
                }
                else
                {
                    value  = text;
                    value2 = text3;
                }
            }
            addValue("CrossPremiseServer", value);
            addValue("CrossPremiseUrlFormat", value2);
            addValue("CrossPremiseServerWorldWide", text);
            addValue("CrossPremiseUrlFormatWorldWide", text3);
            addValue("CrossPremiseServerGallatin", text2);
            addValue("CrossPremiseUrlFormatGallatin", text4);
        }
        private static void LoadTargetDeliveryDomain(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            WebServiceReference webServiceReference           = new WebServiceReference("~/DDI/DDIService.svc?schema=RemoteDomains");
            PowerShellResults <JsonDictionary <object> > list = webServiceReference.GetList(null, null);
            bool   flag  = false;
            string value = null;

            if (list.Output != null)
            {
                for (int i = 0; i < list.Output.Length; i++)
                {
                    Dictionary <string, object> dictionary = list.Output[i];
                    foreach (KeyValuePair <string, object> keyValuePair in dictionary)
                    {
                        if (keyValuePair.Key == "DomainName")
                        {
                            value = (string)keyValuePair.Value;
                        }
                        else if (keyValuePair.Key == "TargetDeliveryDomain")
                        {
                            flag = (bool)keyValuePair.Value;
                        }
                    }
                    if (flag)
                    {
                        break;
                    }
                    value = null;
                }
            }
            if (!list.ErrorRecords.IsNullOrEmpty())
            {
                string errorMessage = list.ErrorRecords[0].ToString();
                logError("EntHasTargetDeliveryDomain", errorMessage);
            }
            addValue("EntTargetDeliveryDomain", value);
            addValue("EntHasTargetDeliveryDomain", flag);
        }