Class Culture
- Namespace
- TimeCockpit.Data.DataModel
- Assembly
- TimeCockpit.Data.dll
Represents a culture. A culture can also have a fallback culture.
public class Culture : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo
- Inheritance
-
ObjectCulture
- Implements
-
IDynamicMetaObjectProviderINotifyPropertyChangedIDataErrorInfo
- Inherited Members
-
Object.ToString()Object.Equals(Object)Object.Equals(Object, Object)Object.ReferenceEquals(Object, Object)Object.GetHashCode()Object.GetType()Object.MemberwiseClone()
Constructors
Culture()
Initializes a new instance of the Culture class
public Culture()
Culture(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the Culture class.
public Culture(IEnumerable<KeyValuePair<object, object>> properties)
Parameters
propertiesIEnumerable<KeyValuePair<Object, Object>>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
public Culture(Culture element)
Parameters
elementCultureThe 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.
public string DatabaseName { get; }
Property Value
- String
FallbackCulture
Gets the fallback culture.
public Culture FallbackCulture { get; }
Property Value
- Culture
The fallback culture.
IsDefaultCulture
Gets a value indicating whether this instance is default culture.
public bool IsDefaultCulture { get; }
Property Value
- Boolean
trueif this instance is default culture; otherwise,false.
Methods
Accept(ModelElementVisitor)
Dispatches the correct visit handler in the visitor.
public override void Accept(ModelElementVisitor visitor)
Parameters
visitorModelElementVisitorthe visitor to accept.
BuildFallbackCultures(IEnumerable<Culture>)
builds the string fallback dictionary.
public static Dictionary<string, string> BuildFallbackCultures(IEnumerable<Culture> cultures)
Parameters
culturesIEnumerable<Culture>the cultures to convert to a dictionary.
Returns
- Dictionary<String, String>
Returns a dictionary containing the fallback culture tree, represented as a key value dictionary.
GetMember(String)
Gets the value of a CLR property.
public override object GetMember(string name)
Parameters
nameStringName of the member to get.
Returns
- Object
Reference to the dynamic member.
RemoveFallbackCulture()
Removes the fallback culture.
public void RemoveFallbackCulture()
SetFallbackCulture(Culture)
Sets the fallback culture.
public void SetFallbackCulture(Culture fallbackCulture)
Parameters
fallbackCultureCultureThe fallback culture.
Validate(ref IList<PropertyValidationMessage>, Boolean)
Validates a ModelElement according to certain rules.
protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
Parameters
messagesIList<PropertyValidationMessage>An list of strings that stores that picks up the validation errors of a model element.
validateRecursivelyBooleanIndicates wheter to validate only the current model element or all its children (recursively) as well.
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.