Csharp/C Sharp by API/System.Globalization/CultureAndRegionInfoBuilder

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

CultureAndRegionInfoBuilder.LoadDataFromCultureInfo

 
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

class Program {
    static void Main(string[] args) {
        CultureAndRegionInfoBuilder styria = new CultureAndRegionInfoBuilder(
            "de-AT-ST", CultureAndRegionModifiers.None);
        styria.LoadDataFromCultureInfo(new CultureInfo("de-AT"));
        styria.LoadDataFromRegionInfo(new RegionInfo("AT"));
        styria.Register();
    }
}


CultureAndRegionInfoBuilder.LoadDataFromRegionInfo

 
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

class Program {
    static void Main(string[] args) {
        CultureAndRegionInfoBuilder styria = new CultureAndRegionInfoBuilder(
            "de-AT-ST", CultureAndRegionModifiers.None);
        styria.LoadDataFromCultureInfo(new CultureInfo("de-AT"));
        styria.LoadDataFromRegionInfo(new RegionInfo("AT"));
        styria.Register();
    }
}


CultureAndRegionInfoBuilder.Save(String fileName)

   
using System;
using System.Globalization;
public class MainClass
{
    static void Main() {
        CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("x-en-US-metric", CultureAndRegionModifiers.None );
        cib.LoadDataFromCultureInfo( new CultureInfo("en-US") );
        cib.LoadDataFromRegionInfo( new RegionInfo("US") );
        cib.IsMetric = true;
        cib.Save( "x-en-US-metric.ldml" );
        cib.Register();
    }
}


new CultureAndRegionInfoBuilder

   

using System;
using System.Globalization;
public class MainClass
{
    static void Main() {
        CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("x-en-US-metric", CultureAndRegionModifiers.None );
        cib.LoadDataFromCultureInfo( new CultureInfo("en-US") );
        cib.LoadDataFromRegionInfo( new RegionInfo("US") );
        cib.IsMetric = true;
        cib.Save( "x-en-US-metric.ldml" );
        cib.Register();
    }
}