S
shapper
Hello,
I have an Enumeration as follows:
Public Enum City
NewYork
London
End Enum
I have a function which returns a string for each City for different
culture:
Public Function City2String(ByVal myCity As City, ByVal culture As
CultureInfo) As String
Select Case culture.Name
Case "pt-PT"
Select Case city
Case Enumeration.City.NewYork
Return "Nova Iorque"
Case Enumeration.City.London
Return "Londres"
...
End Select
End Function
I have a Profile variable named MyCity of type City.
I need to populate the DropDownList with all EnumValues using
City2String to show the text in the correct culture (THIS IS DONE).
Then I need to make something as Profile.MyCity = Selelected Value in
ddlCity.
What should be the best way to do this?
Remember that a DropDownList only has strings. The only think I can
think off is to create a function String2City for all cultures.
However this seems a waste of code.
Any idea?
Thanks,
Miguel
I have an Enumeration as follows:
Public Enum City
NewYork
London
End Enum
I have a function which returns a string for each City for different
culture:
Public Function City2String(ByVal myCity As City, ByVal culture As
CultureInfo) As String
Select Case culture.Name
Case "pt-PT"
Select Case city
Case Enumeration.City.NewYork
Return "Nova Iorque"
Case Enumeration.City.London
Return "Londres"
...
End Select
End Function
I have a Profile variable named MyCity of type City.
I need to populate the DropDownList with all EnumValues using
City2String to show the text in the correct culture (THIS IS DONE).
Then I need to make something as Profile.MyCity = Selelected Value in
ddlCity.
What should be the best way to do this?
Remember that a DropDownList only has strings. The only think I can
think off is to create a function String2City for all cultures.
However this seems a waste of code.
Any idea?
Thanks,
Miguel