Exemplo n.º 1
0
            public void Work()
            {
                try {
                    if (!Directory.Exists(ApplicationData.Instance.GetConfigurationFileRootFolderAbsolutePath()) ||
                        !File.Exists(ApplicationData.Instance.GetConfigurationFileAbsolutePath()))
                    {
                        ConfigurationManager.CreateConfigurationDirectory();
                        ConfigurationManager.CreateEmptyConfiguration();
                    }

                    ConfigurationManager.Load();
                } catch (ConfigurationInvalidException) {
                    var result = MessageBox.Show(LocalizeHelper.GetLocalizedString("PreparationWindow_Ask_RecreateConfigurationFile"), ApplicationData.Instance.AppVersion, MessageBoxButton.YesNo);

                    if (result == MessageBoxResult.Yes)
                    {
                        ConfigurationManager.CreateEmptyConfiguration();
                        ConfigurationManager.Load();
                    }
                }

                if (ConfigurationManager.IsConfigurationReady())
                {
                    LocalizeHelper.SetCurrentUICulture(new System.Globalization.CultureInfo(ConfigurationManager.ConfigurationInstance.UIConfigurations.Language));
                }
            }