Class CultureSensitiveProperty

A culture sensitive property.

Inheritance
object
CultureSensitiveProperty
Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsBase
Assembly: Stylelabs.M.Sdk.dll
Syntax
RequestResponse
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
RequestResponse
public CultureSensitiveProperty(string name, Type type, ISet<CultureInfo> loadedCultures, IDictionary<CultureInfo, object> values)
Parameters
TypeNameDescription
stringname

The name of the property.

Typetype

The type of the property.

ISet<>CultureInfoloadedCultures

The cultures to load.

IDictionary<, >CultureInfoobjectvalues

The values of the property.

CultureSensitiveProperty(string, Type, ISet<CultureInfo>)

Initializes a new instance of the CultureSensitiveProperty class.

Declaration
RequestResponse
public CultureSensitiveProperty(string name, Type type, ISet<CultureInfo> loadedCultures)
Parameters
TypeNameDescription
stringname

The name of the property.

Typetype

The type of the property.

ISet<>CultureInfoloadedCultures

The cultures to load.

Properties

IsDirty

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

Declaration
RequestResponse
public override bool IsDirty { get; }
Property Value
TypeDescription
bool
Overrides

Methods

GetCultures()

Gets all cultures that the property supports. These are always equal to the cultures the IEntity was loaded with.

Declaration
RequestResponse
public IList<CultureInfo> GetCultures()
Returns
TypeDescription
IList<>CultureInfo

The cultures (never null).

GetDirtyCultures()

Gets all cultures that have dirty values.

Declaration
RequestResponse
public IList<CultureInfo> GetDirtyCultures()
Returns
TypeDescription
IList<>CultureInfo

A list of cultures.

GetTypeName()

Gets the type name of the subtype.

Declaration
RequestResponse
protected override string GetTypeName()
Returns
TypeDescription
string

Name of the subtype.

Overrides

GetValue(CultureInfo)

Gets a value.

Declaration
RequestResponse
public object GetValue(CultureInfo culture)
Parameters
TypeNameDescription
CultureInfoculture

The culture.

Returns
TypeDescription
object

The property value.

GetValue<T>(CultureInfo)

Gets the value for a specific culture.

Declaration
RequestResponse
public T GetValue<T>(CultureInfo culture)
Parameters
TypeNameDescription
CultureInfoculture

Culture of the value.

Returns
TypeDescription
T

The value or null if it has no value for this culture.

Type Parameters
NameDescription
T

Type of the value (preferable nullable).

GetValues()

Gets all values per culture in a non generic way.

Declaration
RequestResponse
public IDictionary<CultureInfo, object> GetValues()
Returns
TypeDescription
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
RequestResponse
public IDictionary<CultureInfo, T> GetValues<T>()
Returns
TypeDescription
IDictionary<, >CultureInfo

All property values.

Type Parameters
NameDescription
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
RequestResponse
public IDictionary<CultureInfo, T> GetValues<T>(IEnumerable<CultureInfo> cultures)
Parameters
TypeNameDescription
IEnumerable<>CultureInfocultures

Cultures to include.

Returns
TypeDescription
IDictionary<, >CultureInfo

All property values in the requested cultures.

Type Parameters
NameDescription
T

Type of the value (preferable nullable).

MarkClean()

Marks as clean.

Declaration
RequestResponse
public override void MarkClean()
Overrides

SetValue(CultureInfo, object)

Sets a value for a specific culture.

Declaration
RequestResponse
public void SetValue(CultureInfo culture, object value)
Parameters
TypeNameDescription
CultureInfoculture

Culture of the value.

objectvalue

Value.

StartTracking()

Starts tracking.

Declaration
RequestResponse
public override void StartTracking()
Overrides

Implements

Do you have some feedback for us?

If you have suggestions for improving this article,