Class Culture
Represents a culture. A culture can also have a fallback culture.
Implements
Inherited Members
Namespace: TimeCockpit.Data.DataModel
Assembly: TimeCockpit.Data.dll
Syntax
public class Culture : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo
Constructors
Culture()
Initializes a new instance of the Culture class
Declaration
public Culture()
Culture(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the Culture class.
Declaration
public Culture(IEnumerable<KeyValuePair<object, object>> properties)
Parameters
Type | Name | Description |
---|---|---|
System. |
properties | Collection of properties. |
Remarks
You can use this constructor to initialize a new instance of the ModelRelation class by specifying its properties in a list of key/value pairs. This is especially useful for dynamic languages like python.
Culture(Culture)
Initializes a new instance of the Culture class
Declaration
public Culture(Culture element)
Parameters
Type | Name | Description |
---|---|---|
Culture | element | The culture to copy. |
Remarks
This copy constructor creates copies of all value-typed properties.
Storage
Properties
DatabaseName
Gets the database column name.
Declaration
public string DatabaseName { get; }
Property Value
Type | Description |
---|---|
System. |
FallbackCulture
Gets the fallback culture.
Declaration
public Culture FallbackCulture { get; }
Property Value
Type | Description |
---|---|
Culture | The fallback culture. |
IsDefaultCulture
Gets a value indicating whether this instance is default culture.
Declaration
public bool IsDefaultCulture { get; }
Property Value
Type | Description |
---|---|
System. |
|
Methods
Accept(ModelElementVisitor)
Dispatches the correct visit handler in the visitor.
Declaration
public override void Accept(ModelElementVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
Model |
visitor | the visitor to accept. |
Overrides
BuildFallbackCultures(IEnumerable<Culture>)
builds the string fallback dictionary.
Declaration
public static Dictionary<string, string> BuildFallbackCultures(IEnumerable<Culture> cultures)
Parameters
Type | Name | Description |
---|---|---|
System. |
cultures | the cultures to convert to a dictionary. |
Returns
Type | Description |
---|---|
System. |
Returns a dictionary containing the fallback culture tree, represented as a key value dictionary. |
GetMember(String)
Gets the value of a CLR property.
Declaration
public override object GetMember(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | Name of the member to get. |
Returns
Type | Description |
---|---|
System. |
Reference to the dynamic member. |
Overrides
RemoveFallbackCulture()
Removes the fallback culture.
Declaration
public void RemoveFallbackCulture()
SetFallbackCulture(Culture)
Sets the fallback culture.
Declaration
public void SetFallbackCulture(Culture fallbackCulture)
Parameters
Type | Name | Description |
---|---|---|
Culture | fallbackCulture | The fallback culture. |
Validate(ref IList<PropertyValidationMessage>, Boolean)
Validates a Model
Declaration
protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
Parameters
Type | Name | Description |
---|---|---|
System. |
messages | An list of strings that stores that picks up the validation errors of a model element. |
System. |
validateRecursively | Indicates wheter to validate only the current model element or all its children (recursively) as well. |
Overrides
Remarks
The rules the Model
When Validate(ref IList<PropertyValidationMessage>, Boolean) is called on a modelelement, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attatched to the modelelemnt are validated recursivly.