public static string GetEnvironmentTypeUsingNewLogic()
        {
            string str = EnvironmentSettings.GetEnvironmentFromDeployment();

            if (str == null)
            {
                str = EnvironmentSettings.GetEnvironmentFromStartupDirectory();
                if (str == null)
                {
                    str = ConfigurationManager.AppSettings["Environment"];
                    if (str == null)
                    {
                        RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software\\AQR");
                        if (registryKey != null)
                        {
                            str = (string)registryKey.GetValue("Environment");
                        }
                    }
                }
            }
            return(str);
        }