Strongly typed resource class, DOT NET Programming

Assignment Help:

Can we get a strongly typed resource class?

You can now get strongly types classes in the VS.NET intellisense as shown in the figure below.

42_resource class.png

Figure: - Strongly typed resource class

All belongs to the Resources namespace. Let do a small sample and see how the strongly typed classes work in the VS.NET 2005 and the simplicity which they bring while implementing globalization in the projects. The screen shot of the project is shown below. It is basically a simple login screen with user id and password text boxes. The User has options to select the language. Currently only two languages are provided English & Greek. Depending on the selected languages the user id and password label values will be displayed.

1013_resource class1.png

Figure: - Strongly typed project

The code snippet below describes the various important parts of the code. The First thing is the resource files. We have generated two resource files one for Greece with el and the second is the general resource file which will be used when the regional code does not match.

2357_resource class2.png

Figure: - Walkthrough for using the resources namespace

There are three main steps in the code:-

1) The First step is to set the culture information for the current thread with the new culture info object. The StrCulture has the language code which is presently selected in the drop down.

Thread.CurrentThread.CurrentCulture = new CultureInfo(strCulture);

2) We set the similar culture to the Resource class.

Resources.Resource.Culture = Thread.CurrentThread.CurrentCulture;

 3) Now we are all set to use the value.

lblUserId.Text = Resources.Resource.lblUserIdResource1.ToString();

lblPassword.Text = Resources.Resource.lblPasswordResource1.ToString();


Related Discussions:- Strongly typed resource class

Uml, What is UML? The Unified Modeling Language (UML) is a graphical la...

What is UML? The Unified Modeling Language (UML) is a graphical language for documenting, specifying, visualizing,  constructing, and  the artifacts of a software-intensive sys

Experienced .net certified developers, Project Description: We are seeki...

Project Description: We are seeking experienced .NET developers (possibly certified) to work with us on several future projects. You will have to pass a simple test to be consid

Need help to solve questions of vb.net, VB.NET Questions Project Descrip...

VB.NET Questions Project Description: Need help to solve questions of VB.NET Skills required: .NET, Software Development, C# Programming, Visual Basic, Windows Deskt

Consumer and dealer management, Consumer and Dealer management Project D...

Consumer and Dealer management Project Description: Need to code the existing UI for relative and CRUD automation. Prepare CRUD for almost 7-10 forms with search and repor

Class in dot net, What is a Class in dot Net? The class describes all t...

What is a Class in dot Net? The class describes all the attributes of objects, as well as the methods which implement the behavior of member objects. It is a comprehensive data

Steps to create a webservice, What are the steps to create a webservice? ...

What are the steps to create a webservice? This webservice will add 2 numbers and send  to the calling client.All the below steps shown are according to VS2005 beta editor :-

Dynamic web presentation tier, Part 1 requires you to complete a dynamic we...

Part 1 requires you to complete a dynamic web presentation tier, based on your MiddlewareLib.dll  library. This should run as an ASP.NET page, Default.aspx, under WebDev.WebServer,

Methods provided by the command object, What are the methods provided by th...

What are the methods provided by the command object? The command objects used to connect the connection object to the Datareader or the dataset. The command object provided som

Use of culture auto, How can we use Culture Auto in project? We will ma...

How can we use Culture Auto in project? We will make a very simple login screen which we will try to use for English as well as the Greek. The login screen will display Engl

Nested classes, What is nested Classes? You can access an array using t...

What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd