private void cbEnv_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (cbEnv.SelectedItem == null)
            {
                return;
            }
            var          item       = (KeyValuePair <string, CloudSetting>)cbEnv.SelectedItem;
            CloudSetting newsetting = item.Value;

            if (newsetting.Name == "AzureCloud")
            {
                configFileMgr.DeleteAadConfigFile();
            }
            else
            {
                configFileMgr.CreateSovereignCloudConfig(newsetting);
            }
            CheckModeSetUI();
        }
        public void CreateSovereignCloudConfig(CloudSetting setting)
        {
            string jsonconfig = null;

            jsonconfig = setting.JsonConfig;
            VerifyDirectory();
            var configFilePath = GetConfigFilePath();

            File.WriteAllText(configFilePath, jsonconfig);

            void VerifyDirectory()
            {
                var aadConfigDir = GetAadConfigDirectory();

                if (!Directory.Exists(aadConfigDir))
                {
                    Directory.CreateDirectory(aadConfigDir);
                }
            }
        }