O'Reilly logo

Professional Visual Studio® 2010 by Chris Anderson, Michael Minutillo, David Gardner, Nick Randolph

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 38. Resource Files

WHAT'S IN THIS CHAPTER?

  • Understanding what an application resource is

  • Defining and using resources within your application

  • Defining culture-specific resources

  • Extending the default resource types

Developers often overlook the humble XML resource file, because it is often hidden by Visual Studio 2010 so as not to clutter the solution. Because its most common use is as a backing file for forms or web pages, you can write large applications without interacting directly with resource files. However, resource files are an important tool that you need to be able to use in order to write applications that can be easily maintained and translated into other languages.

The first part of this chapter explains why resource files are important and describes the features that enable developers to work with them. The remainder of the chapter explains how you can use resource files to localize an application for different languages and cultures.

WHAT ARE RESOURCES?

A resource is any data required by an application, whether it is a string, an icon, an image, or even an audio clip. Resources are non-executable and support the running of the application through the provision of data such as location, size, and other physical properties of controls. Though most resources are strings, images, audio clips, or icons, there is no reason why a resource could not be a more complex object that supports serialization.

Three types of resource files can be compiled into an application: text, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required