Adds Dictionary and Language implementations for U4-929 and U4-930

This commit is contained in:
Morten@Thinkpad-X220
2012-10-04 07:06:01 -02:00
parent e77d5bbbe5
commit 612d57c00a
4 changed files with 151 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
using System;
using System.Reflection;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
public class DictionaryTranslation : Entity
{
private Language _language;
private string _value;
public DictionaryTranslation(Language language, string value)
{
_language = language;
_value = value;
}
public DictionaryTranslation(Language language, string value, Guid uniqueId)
{
_language = language;
_value = value;
Key = uniqueId;
}
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, Language>(x => x.Language);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
public Language Language
{
get { return _language; }
set
{
_language = value;
OnPropertyChanged(LanguageSelector);
}
}
public string Value
{
get { return _value; }
set
{
_value = value;
OnPropertyChanged(ValueSelector);
}
}
}
}