471,347 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,347 software developers and data experts.

Any way to do this function?

a
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m
Jan 27 '06 #1
2 972
If EngName and ChiName are properties then you already have the behavior you
are asking for: If you request the value of a property, that's what you'll
get.

I suspect there must be more to your question. Can you provide more
information?
--
Dale Preston
MCAD C#
MCSE, MCDBA
"ºa¤Ö" wrote:
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m

Jan 27 '06 #2
a wrote:
I have a class named country and have following properites

string EngName
string ChiName

How to do if user request EngName, then it can return EngName, if user
request ChiName, if can return ChiName
but i do not want to using if-then-else since it maybe have KrName, ThaiName
in the furture.

Thanks

m(_ _)m


That's not how localization is usually done. You'd want something more like

string CountryName

which is looked up from a resource file depending on the user's locale
automatically... I'm sure if you look into any localization article
you'll find tons of such infos.
Jan 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bryan Parkoff | last post: by
3 posts views Thread by HopfZ | last post: by
6 posts views Thread by =?iso-8859-1?B?QW5kcuk=?= | last post: by
kiss07
6 posts views Thread by kiss07 | last post: by
11 posts views Thread by noddy | last post: by
12 posts views Thread by viza | last post: by
3 posts views Thread by lancer6238 | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.