Registration of Custom Culture
The registration process, when calling the Register() method, does the following:
1. An .nlp file is created. This file contains all information defined in the CultureAndRegionInfoBuilder instance.
2. Next, the .nlp file is stored in the %WINDIR%\Globalization system directory on the computer (i.e. C:\WINDOWS\Globalization\). Hence, the culture information will still be available when the computer is restarted at a later time.
Note: Since the .nlp file is stored in a system directory, to register a custom culture you must have administrative priviledges on the computer.
3. The final step is the preparation of the .NET Framework to search the %WINDIR%\Globalization system directory the next time there is a request to create a new custom culture. An InvalidOperationException will be thrown if an attempt to register a culture more than once is made.
Persistance of Custom Culture
Another interesting feature about the CultureAndRegionInfoBuilder is its ability to write an XML representation of the object to a specified file. This can be achieved using the Save() method.
// save the new culture
// for instantiation of the infoBuilder object, see previous post
infoBuilder.Save("c:/en-mu.xml");
0 comments:
Post a Comment