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.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>> | 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. StorageColumns and Permissions from element are just added to the corresponding collections of the new Culture. No copying is performed.
Properties
DatabaseName
Gets the database column name.
Declaration
public string DatabaseName { get; }
Property Value
Type | Description |
---|---|
System.String |
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.Boolean |
|
Methods
Accept(ModelElementVisitor)
Dispatches the correct visit handler in the visitor.
Declaration
public override void Accept(ModelElementVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ModelElementVisitor | 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.Collections.Generic.IEnumerable<Culture> | cultures | the cultures to convert to a dictionary. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | 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.String | name | Name of the member to get. |
Returns
Type | Description |
---|---|
System.Object | 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 ModelElement according to certain rules.
Declaration
protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<PropertyValidationMessage> | messages | An list of strings that stores that picks up the validation errors of a model element. |
System.Boolean | validateRecursively | Indicates wheter to validate only the current model element or all its children (recursively) as well. |
Overrides
Remarks
The rules the ModelElement is validated against are dependent on the type of ModelElement that is validated. This method can be overridden to provide custom validation behavior for subclasses of ModelElement
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.