X hits on this document

191 views

0 shares

0 downloads

0 comments

31 / 67

CUSTOM CULTURES

CultureAndRegionInfoBuilder builder = CultureAndRegionInfoBuilder.CreateFromLdml(“en-GB.ldml”);

builder.Register();

The important parts of the RegisterCustomCulture console application are shown here:

static void Main(string[] args) {

Console.WriteLine(“RegisterCustomCulture registers custom” +

“ cultures for the .NET Framework from LDML/XML files”); Console.WriteLine(“”); if (args.GetLength(0) == 0)

// no parameters were passed – show the syntax ShowSyntax(); else if (AllFilesExist(args)) {

// file parameters are all good – register the cultures RegisterCustomCultures(args);

}

}

private static void RegisterCustomCultures( string[] customCultureFiles) {

foreach (string customCultureFile in customCultureFiles) { || if (customCultureFile.StartsWith(“/u:”) customCultureFile.StartsWith(“/U:”))

{

// unregister the culture string customCultureName = customCultureFile.Substring(3);

CultureAndRegionInfoBuilder.Unregister( customCultureName);

Console.WriteLine(“{0} custom culture unregistered”, customCultureName);

} else {

// register the culture CultureAndRegionInfoBuilder builder =

CultureAndRegionInfoBuilder.CreateFromLdml( customCultureFile);

7

Document info
Document views191
Page views191
Page last viewedSat Dec 10 19:28:42 UTC 2016
Pages67
Paragraphs859
Words13458

Comments