1. Stylelabs.M.Sdk.Models.Base

Class CultureSensitiveProperty

A culture sensitive property.

Inheritance

object

MemberBase

PropertyBase

CultureSensitiveProperty

Implements

ICultureSensitiveProperty

IProperty

IMember

ICultureSensitiveDirtyTracking

IDirtyTracking

Inherited Members

PropertyBase.IsMultiLanguage

PropertyBase.DataType

PropertyBase.DefinitionType

MemberBase.Name

MemberBase.IsTracking

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, 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

TypeNameDescription
stringnameThe name of the property.
TypetypeThe type of the property.
ISet<>CultureInfoloadedCulturesThe cultures to load.
IDictionary<, >CultureInfoobjectvaluesThe values of the property.

CultureSensitiveProperty(string, Type, ISet)

Initializes a new instance of the CultureSensitiveProperty class.

Declaration

public CultureSensitiveProperty(string name, Type type, ISet<CultureInfo> loadedCultures)

Parameters

TypeNameDescription
stringnameThe name of the property.
TypetypeThe type of the property.
ISet<>CultureInfoloadedCulturesThe cultures to load.

Properties

IsDirty

Gets a value indicating whether the property is dirty or not.

Declaration

public override bool IsDirty { get; }

Property Value

TypeDescription
bool

Overrides

MemberBase.IsDirty

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

TypeDescription
IList<>CultureInfoThe cultures (never null).

GetDirtyCultures()

Gets all cultures that have dirty values.

Declaration

public IList<CultureInfo> GetDirtyCultures()

Returns

TypeDescription
IList<>CultureInfoA list of cultures.

GetTypeName()

Gets the type name of the subtype.

Declaration

protected override string GetTypeName()

Returns

TypeDescription
stringName of the subtype.

Overrides

PropertyBase.GetTypeName()

GetValue(CultureInfo)

Gets a value.

Declaration

public object GetValue(CultureInfo culture)

Parameters

TypeNameDescription
CultureInfocultureThe culture.

Returns

TypeDescription
objectThe property value.

GetValue(CultureInfo)

Gets the value for a specific culture.

Declaration

public T GetValue<T>(CultureInfo culture)

Parameters

TypeNameDescription
CultureInfocultureCulture of the value.

Returns

TypeDescription
TThe value or null if it has no value for this culture.

Type Parameters

NameDescription
TType of the value (preferable nullable).

GetValues()

Gets all values per culture in a non generic way.

Declaration

public IDictionary<CultureInfo, object> GetValues()

Returns

TypeDescription
IDictionary<, >CultureInfoobjectProperty values.

Remarks

This method only returns the values in the cultures the IEntity was loaded in.

GetValues()

Gets all values per culture.

Declaration

public IDictionary<CultureInfo, T> GetValues<T>()

Returns

TypeDescription
IDictionary<, >CultureInfoAll property values.

Type Parameters

NameDescription
TType of the value (preferable nullable).

Remarks

This method only returns the values in the cultures the IEntity was loaded in.

GetValues(IEnumerable)

Gets all values in the requested cultures.

Declaration

public IDictionary<CultureInfo, T> GetValues<T>(IEnumerable<CultureInfo> cultures)

Parameters

TypeNameDescription
IEnumerable<>CultureInfoculturesCultures to include.

Returns

TypeDescription
IDictionary<, >CultureInfoAll property values in the requested cultures.

Type Parameters

NameDescription
TType of the value (preferable nullable).

MarkClean()

Marks as clean.

Declaration

public override void MarkClean()

Overrides

MemberBase.MarkClean()

SetValue(CultureInfo, object)

Sets a value for a specific culture.

Declaration

public void SetValue(CultureInfo culture, object value)

Parameters

TypeNameDescription
CultureInfocultureCulture of the value.
objectvalueValue.

StartTracking()

Starts tracking.

Declaration

public override void StartTracking()

Overrides

MemberBase.StartTracking()

Implements

ICultureSensitiveProperty

IProperty

IMember

ICultureSensitiveDirtyTracking

IDirtyTracking

If you have suggestions for improving this article, let us know!