public Form1() { InitializeComponent(); options = new NCldrBuilderOptions(); InitializeDataSources(); }
private void btnLoad_Click(object sender, EventArgs e) { if (!File.Exists(tbxConfigFilename.Text)) { MessageBox.Show("The config file does not exist", "NCLDR Builder"); } else { try { NCldrBuilderOptions builderOptions = NCldrBuilderOptions.Load(tbxConfigFilename.Text); UpdateBuilderOptions(builderOptions); MessageBox.Show("Config file loaded", "NCLDR Builder"); } catch (Exception exception) { MessageBox.Show(String.Format("Unable to load config file ({0})", exception.Message), "NCLDR Builder"); } } }
private void UpdateBuilderOptions(NCldrBuilderOptions builderOptions) { this.options = builderOptions; cbxIncludeCultureNames.Checked = options.IncludeCultureNames; cbxIncludeCalendarPreferences.Checked = options.IncludeCalendarPreferences; cbxIncludeCharacterFallbacks.Checked = options.IncludeCharacterFallbacks; cbxIncludeCultures.Checked = options.IncludeCultures; cbxIncludeCurrencies.Checked = options.IncludeCurrencies; cbxIncludeCurrencyFractions.Checked = options.IncludeCurrencyFractions; cbxIncludeCalendarTypes.Checked = options.IncludeCalendarTypes; cbxIncludeDayPeriodRuleSets.Checked = options.IncludeDayPeriodRuleSets; cbxIncludeGenderLists.Checked = options.IncludeGenderLists; cbxIncludeLanguageMatches.Checked = options.IncludeLanguageMatches; cbxIncludeLikelySubTags.Checked = options.IncludeLikelySubTags; cbxIncludeMeasurementData.Checked = options.IncludeMeasurementData; cbxIncludeMetaTimeZones.Checked = options.IncludeMetaTimeZones; cbxIncludeNumeringSystems.Checked = options.IncludeNumberingSystems; cbxIncludeOrdinalRuleSets.Checked = options.IncludeOrdinalRuleSets; cbxIncludeParentCultures.Checked = options.IncludeParentCultures; cbxIncludePluralRuleSets.Checked = options.IncludePluralRuleSets; cbxIncludePostcodeRegexes.Checked = options.IncludePostcodeRegexes; cbxIncludeReferences.Checked = options.IncludeReferences; cbxIncludeRegionCodes.Checked = options.IncludeRegionCodes; cbxIncludeRegionGroups.Checked = options.IncludeRegionGroups; cbxIncludeRegionInformations.Checked = options.IncludeRegionInformations; cbxIncludeRegionTelephoneCodes.Checked = options.IncludeRegionTelephoneCodes; cbxIncludeTimeData.Checked = options.IncludeTimeData; cbxIncludeTimeZones.Checked = options.IncludeTimeZones; cbxIncludeWeekData.Checked = options.IncludeWeekData; cbxIncludeWindowsMetaTimeZones.Checked = options.IncludeWindowsMetaTimeZones; cbxIncludeLanguageDisplayNames.Checked = options.CultureOptions.IncludeLanguageDisplayNames; cbxIncludeRegionDisplayNames.Checked = options.CultureOptions.IncludeRegionDisplayNames; cbxIncludeScriptDisplayNames.Checked = options.CultureOptions.IncludeScriptDisplayNames; cbxIncludeCasing.Checked = options.CultureOptions.IncludeCasing; cbxIncludeCharacters.Checked = options.CultureOptions.IncludeCharacters; cbxIncludeDates.Checked = options.CultureOptions.IncludeDates; cbxIncludeDelimiters.Checked = options.CultureOptions.IncludeDelimiters; cbxIncludeLayouts.Checked = options.CultureOptions.IncludeLayout; cbxIncludeListPatterns.Checked = options.CultureOptions.IncludeListPatterns; cbxIncludeMessages.Checked = options.CultureOptions.IncludeMessages; cbxIncludeNumbers.Checked = options.CultureOptions.IncludeNumbers; cbxIncludeRuleBasedNumberFormatting.Checked = options.CultureOptions.IncludeRuleBasedNumberFormatting; cbxIncludeUnitPatternSets.Checked = options.CultureOptions.IncludeUnitPatternSets; if (options.CultureOptions.CultureSelection == CultureSelection.All) { rbAllCultures.Checked = true; clbCultures.Items.Clear(); } else if (options.CultureOptions.CultureSelection == CultureSelection.AllExceptExclude) { string[] cultures = options.CultureOptions.ExcludeCultures; rbExclude.Checked = true; options.CultureOptions.ExcludeCultures = cultures; SetCheckedItems(options.CultureOptions.ExcludeCultures); } else if (options.CultureOptions.CultureSelection == CultureSelection.IncludeOnly) { string[] cultures = options.CultureOptions.IncludeCultures; rbIncludeOnly.Checked = true; options.CultureOptions.IncludeCultures = cultures; SetCheckedItems(options.CultureOptions.IncludeCultures); } else if (options.CultureOptions.CultureSelection == CultureSelection.AllNew) { rbAllNewCultures.Checked = true; clbCultures.Items.Clear(); } }