Exemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            options = new NCldrBuilderOptions();

            InitializeDataSources();
        }
Exemplo n.º 2
0
        public static void Build(
            string cldrPath,
            string ncldrPath,
            NCldrBuilderProgressEventHandler progress = null,
            NCldrBuilderOptions options = null)
        {
            INCldrFileDataSource dataSource = new NCldrBinaryFileDataSource();
            dataSource.NCldrDataPath = ncldrPath;

            Build(cldrPath, dataSource, progress, options);
        }
Exemplo n.º 3
0
        public static void Build(
            string cldrPath,
            string ncldrPath,
            NCldrBuilderProgressEventHandler progress = null,
            NCldrBuilderOptions options = null)
        {
            INCldrFileDataSource dataSource = new NCldrBinaryFileDataSource();

            dataSource.NCldrDataPath = ncldrPath;

            Build(cldrPath, dataSource, progress, options);
        }
Exemplo n.º 4
0
        public static void Build(
            string cldrPath,
            INCldrFileDataSource dataSource,
            NCldrBuilderProgressEventHandler progress = null,
            NCldrBuilderOptions options = null)
        {
            NCldrBuilder.options         = options;
            NCldrBuilder.progress        = progress;
            NCldrBuilder.cldrPath        = cldrPath;
            NCldrBuilder.ncldrDataSource = dataSource;

            supplementalDataDocument = GetXmlDocument(@"common\supplemental\supplementalData.xml");

            NCldrData ncldrData = new NCldrData();

            ncldrData.CultureNames         = GetCultureNames();
            ncldrData.CultureDatas         = GetCultures();
            ncldrData.CalendarPreferences  = GetCalendarPreferences();
            ncldrData.CalendarTypes        = GetCalendarTypes();
            ncldrData.CharacterFallbacks   = GetCharacterFallbacks();
            ncldrData.Currencies           = GetDescriptions <Currency>("currency", "cu", "currency");
            ncldrData.CurrencyFractions    = GetCurrencyFractions();
            ncldrData.DayPeriodRuleSets    = GetDayPeriodRuleSets();
            ncldrData.GenderLists          = GetGenderLists();
            ncldrData.LanguageMatches      = GetLanguageMatches();
            ncldrData.LikelySubTags        = GetLikelySubTags();
            ncldrData.MeasurementData      = GetMeasurementData();
            ncldrData.MetaTimeZones        = GetMetaTimeZones();
            ncldrData.NumberingSystems     = GetNumberingSystems();
            ncldrData.OrdinalRuleSets      = GetPluralRuleSets(true);
            ncldrData.ParentCultures       = GetParentCultures();
            ncldrData.PluralRuleSets       = GetPluralRuleSets(false);
            ncldrData.PostcodeRegexes      = GetPostcodeRegexes();
            ncldrData.References           = GetReferences();
            ncldrData.RegionCodes          = GetRegionCodes();
            ncldrData.RegionGroups         = GetRegionGroups();
            ncldrData.RegionInformations   = GetRegionInformations();
            ncldrData.RegionTelephoneCodes = GetRegionTelephoneCodes();
            ncldrData.TimeData             = GetTimeData();
            ncldrData.TimeZones            = GetTimeZones();
            ncldrData.WeekData             = GetWeekData();
            ncldrData.WindowsMetaTimeZones = GetWindowsMetaTimeZones();

            Build(ncldrData);
        }
Exemplo n.º 5
0
        public static void Build(
            string cldrPath, 
            INCldrFileDataSource dataSource, 
            NCldrBuilderProgressEventHandler progress = null,
            NCldrBuilderOptions options = null)
        {
            NCldrBuilder.options = options;
            NCldrBuilder.progress = progress;
            NCldrBuilder.cldrPath = cldrPath;
            NCldrBuilder.ncldrDataSource = dataSource;

            supplementalDataDocument = GetXmlDocument(@"common\supplemental\supplementalData.xml");

            NCldrData ncldrData = new NCldrData();
            ncldrData.CultureNames = GetCultureNames();
            ncldrData.CultureDatas = GetCultures();
            ncldrData.CalendarPreferences = GetCalendarPreferences();
            ncldrData.CalendarTypes = GetCalendarTypes();
            ncldrData.CharacterFallbacks = GetCharacterFallbacks();
            ncldrData.Currencies = GetDescriptions<Currency>("currency", "cu", "currency");
            ncldrData.CurrencyFractions = GetCurrencyFractions();
            ncldrData.DayPeriodRuleSets = GetDayPeriodRuleSets();
            ncldrData.GenderLists = GetGenderLists();
            ncldrData.LanguageMatches = GetLanguageMatches();
            ncldrData.LikelySubTags = GetLikelySubTags();
            ncldrData.MeasurementData = GetMeasurementData();
            ncldrData.MetaTimeZones = GetMetaTimeZones();
            ncldrData.NumberingSystems = GetNumberingSystems();
            ncldrData.OrdinalRuleSets = GetPluralRuleSets(true);
            ncldrData.ParentCultures = GetParentCultures();
            ncldrData.PluralRuleSets = GetPluralRuleSets(false);
            ncldrData.PostcodeRegexes = GetPostcodeRegexes();
            ncldrData.References = GetReferences();
            ncldrData.RegionCodes = GetRegionCodes();
            ncldrData.RegionGroups = GetRegionGroups();
            ncldrData.RegionInformations = GetRegionInformations();
            ncldrData.RegionTelephoneCodes = GetRegionTelephoneCodes();
            ncldrData.TimeData = GetTimeData();
            ncldrData.TimeZones = GetTimeZones();
            ncldrData.WeekData = GetWeekData();
            ncldrData.WindowsMetaTimeZones = GetWindowsMetaTimeZones();

            Build(ncldrData);
        }
Exemplo n.º 6
0
        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();
            }
        }