Freigeben über


Names of Resources 

The guidelines in this topic apply to localizable resources such as error messages and menu text.

Do use Pascal casing in resource keys.

Do provide descriptive rather than short identifiers. Keep them concise where possible, but do not sacrifice readability.

Do not use language-specific keywords from the common language runtime (CLR) programming languages.

Do use only alphanumeric characters and underscores in naming resources.

Do use the dot separator (".") to nest identifiers with a clear hierarchy.

For example, names such as Menus.FileMenu.Close.Text and Menus.FileMenu.Close.Color conform to this guideline.

Do use the following naming convention for exception message resources. The resource identifier should be the exception type name plus a short identifier of the exception separated by a dot.

For example, ArgumentException.BadEnumValue conforms to this guideline.

Portions Copyright 2005 Microsoft Corporation. All rights reserved.

Portions Copyright Addison-Wesley Corporation. All rights reserved.

For more information on design guidelines, see the "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries" book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.

See Also

Other Resources

Design Guidelines for Developing Class Libraries
Guidelines for Names