Nearly every production quality application needs to use resources. A resource is any non-executable data that is logically deployed with an application. The data can take any number of forms such as as strings, images, persisted objects, etc.
An application often needs to be customized for different cultures. A culture is a set of preferences based on a user’s language, sub-language, and cultural conventions. In the NGWS framework, the Base Class Library describes a culture using the CultureInfo class. A culture is used to customize operations such as formatting of dates and numbers, sorting of strings, etc.
An application also often need to be customized for different countries or regions. A region is a set of standards for a particular country or region of the world. In the NGWS framework, the Base Class Library describes a region using the RegionInfo class. A region is used to customize operations such as formatting the currency symbol.
Localization of an application is the process of sharing the application’s executable code with the application’s resources customized for specific cultures. Although a culture and a region together constitute a locale, localization is not concerned with customizing an application to specific regions. The NGWS runtime does not support localization of component metadata.
This specification describes resources at a low-level as a collection of named bits in an assembly. An assembly is the unit of deployment, versioning, and name resolution in the NGWS runtime. The goal at this level is for the resources to be generic, extensible, and consistent with content generated by other tools. Resources at this level are stored and retrieved using metadata APIs and low-level Base Class Library methods of the Assembly class. These APIs are primarily of interest to developers of compilers, assemblers, and other tools.
The Base Class Library also provides a high-level abstraction (see System.Resources Overview) as a set of managed classes. The managed classes impose policies and ensure consistency in how resources are stored and retrieved. The high-level APIs are primarily of interest to developers of applications.
The scope of this specification is limited to describing NGWS runtime resources. Unmanaged code uses resources in legacy Win32 format. Win32 provides a rich set of APIs to access legacy resources. Trusted managed code can use the PInvoke mechanism to call the Win32 APIs.
The following sections detail resources in the NGWS runtime. Section Packaging and Deployment of Resources describes how resources are packaged and deployed. The two resource models are described in the next two sections. Section Low-Level Resource Model describes the low-level abstraction of resources.