Skip to content

Instantly share code, notes, and snippets.

@Buthrakaur
Created February 26, 2010 10:23
Show Gist options
  • Save Buthrakaur/315606 to your computer and use it in GitHub Desktop.
Save Buthrakaur/315606 to your computer and use it in GitHub Desktop.
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