Created
February 26, 2010 10:23
-
-
Save Buthrakaur/315606 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ciselnik | |
{ | |
public long Id{ get; set;} | |
public LocalizedText Name{ get; set;} | |
public IEnumerable<PolozkaCiselniku> Items { get; set; } | |
} | |
public class PolozkaCiselniku | |
{ | |
public long Id{ get; set;} | |
public string Code{ get; set;} | |
public LocalizedText Name{get; set;} | |
public DateTime ValidFrom { get; set; } | |
public DateTime ValidTo { get; set; } | |
} | |
public class LocalizedText | |
{ | |
public long Id { get; set; } | |
public string BaseValue{ get; set;} | |
private IDictionary<CultureInfo, string> LocalizedTexts{ get; set;} | |
public string GetLocalizedValue() | |
{ | |
var culture = System.Threading.Thread.CurrentThread.CurrentUICulture; | |
if (culture == null || !LocalizedTexts.ContainsKey(culture)) | |
{ | |
return BaseValue; | |
} | |
return LocalizedTexts[culture]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment