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

Newly designed apk file for xbmc on an android tv box, Newly designed APK f...

Newly designed APK file for XBMC on an Android TV Box Project Description: We are seeking someone to have knowledge in Android's operating platform. We are a business that ma

I need online real commission management system, I need Online Real Commiss...

I need Online Real Commission Management system Project Description: Real Estate -- Store and retrieve Purchase plot customers, Employee to refer the customers get commiss

Academic expert for genetic algorithm, I need Academic expert for Genetic A...

I need Academic expert for Genetic Algorithm Project Description: Seeking academic expert for Genetic Algorithm. Please bid on this project if you will start work today. S

Basic methods of data adapter, What are basic methods of Data adapter? ...

What are basic methods of Data adapter? The three most commonly used methods of Dataadapter are as follows:- 1)Fill :- It Executes the SelectCommand to fill the DataSet ob

Writing project with uml diagram, Project Description:                     ...

Project Description:                                   Urgently require an expert with good knowledge of writing experience and UML diagrams. This project requires technologi

Inheritance, Assignment for inheritance based on c#

Assignment for inheritance based on c#

Mention different types of data providers available in .net, Mention differ...

Mention different types of data providers available in .NET Framework. .NET Framework Data Provider for SQL Server - Give access to Microsoft SQL Server 7.0 or later version. I

Jquery and mvc 4.5 training session, Jquery and MVC 4.5 Training Session ...

Jquery and MVC 4.5 Training Session I am looking who have industry experience working on Microsoft Technology ( MVC 4.5 ) and Jquery, who will take live online session and provi

Create a website for online sales of movies, Niles Video Inc. wants to crea...

Niles Video Inc. wants to create a website for online sales of movies (DVD and videotapes). People will be allowed to register as customers on the website and to update their store

V model in testing, What is V model in testing? The V model map's the t...

What is V model in testing? The V model map's the type of test to the stage of development in the project. Figure: - V Model 1) Unit Testing: The Starting fro

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