Class CultureSensitiveProperty
A culture sensitive property.
Implements
Inherited Members
Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsBase
Assembly: Stylelabs.M.Sdk.dll
Syntax
public class CultureSensitiveProperty : PropertyBase, ICultureSensitiveProperty, IProperty, IMember, ICultureSensitiveDirtyTracking, IDirtyTracking
Constructors
CultureSensitiveProperty(string, Type, ISet<CultureInfo>, IDictionary<CultureInfo, object>)
Initializes a new instance of the CultureSensitiveProperty class.
Declaration
public CultureSensitiveProperty(string name, Type type, ISet<CultureInfo> loadedCultures, IDictionary<CultureInfo, object> values)
Parameters
Type | Name | Description |
---|---|---|
string | name |
The name of the property. |
Type | type |
The type of the property. |
ISet<>CultureInfo | loadedCultures |
The cultures to load. |
IDictionary<, >CultureInfoobject | values |
The values of the property. |
CultureSensitiveProperty(string, Type, ISet<CultureInfo>)
Initializes a new instance of the CultureSensitiveProperty class.
Declaration
public CultureSensitiveProperty(string name, Type type, ISet<CultureInfo> loadedCultures)
Parameters
Type | Name | Description |
---|---|---|
string | name |
The name of the property. |
Type | type |
The type of the property. |
ISet<>CultureInfo | loadedCultures |
The cultures to load. |
Properties
IsDirty
Gets a value indicating whether the property is dirty or not.
Declaration
public override bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
GetCultures()
Gets all cultures that the property supports. These are always equal to the cultures the IEntity was loaded with.
Declaration
public IList<CultureInfo> GetCultures()
Returns
Type | Description |
---|---|
IList<>CultureInfo |
The cultures (never null). |
GetDirtyCultures()
Gets all cultures that have dirty values.
Declaration
public IList<CultureInfo> GetDirtyCultures()
Returns
Type | Description |
---|---|
IList<>CultureInfo |
A list of cultures. |
GetTypeName()
Gets the type name of the subtype.
Declaration
protected override string GetTypeName()
Returns
Type | Description |
---|---|
string |
Name of the subtype. |
Overrides
GetValue(CultureInfo)
Gets a value.
Declaration
public object GetValue(CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture |
The culture. |
Returns
Type | Description |
---|---|
object |
The property value. |
GetValue<T>(CultureInfo)
Gets the value for a specific culture.
Declaration
public T GetValue<T>(CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture |
Culture of the value. |
Returns
Type | Description |
---|---|
T |
The value or null if it has no value for this culture. |
Type Parameters
Name | Description |
---|---|
T |
Type of the value (preferable nullable). |
GetValues()
Gets all values per culture in a non generic way.
Declaration
public IDictionary<CultureInfo, object> GetValues()
Returns
Type | Description |
---|---|
IDictionary<, >CultureInfoobject |
Property values. |
Remarks
This method only returns the values in the cultures the IEntity was loaded in.
GetValues<T>()
Gets all values per culture.
Declaration
public IDictionary<CultureInfo, T> GetValues<T>()
Returns
Type | Description |
---|---|
IDictionary<, >CultureInfo |
All property values. |
Type Parameters
Name | Description |
---|---|
T |
Type of the value (preferable nullable). |
Remarks
This method only returns the values in the cultures the IEntity was loaded in.
GetValues<T>(IEnumerable<CultureInfo>)
Gets all values in the requested cultures.
Declaration
public IDictionary<CultureInfo, T> GetValues<T>(IEnumerable<CultureInfo> cultures)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<>CultureInfo | cultures |
Cultures to include. |
Returns
Type | Description |
---|---|
IDictionary<, >CultureInfo |
All property values in the requested cultures. |
Type Parameters
Name | Description |
---|---|
T |
Type of the value (preferable nullable). |
MarkClean()
Marks as clean.
Declaration
public override void MarkClean()
Overrides
SetValue(CultureInfo, object)
Sets a value for a specific culture.
Declaration
public void SetValue(CultureInfo culture, object value)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture |
Culture of the value. |
object | value |
Value. |
StartTracking()
Starts tracking.
Declaration
public override void StartTracking()