Class TextProperty
Represents a property of type text in the Time Cockpit data model.
Inheritance
Implements
Inherited Members
Namespace: TimeCockpit.Data.DataModel
Assembly: TimeCockpit.Data.dll
Syntax
[DataType(typeof(string))]
[Column(typeof(string), SizePropertyName = "MaxStorageSize")]
[DefaultValue("")]
[FriendlyTypeName("Text")]
public class TextProperty : PersistedProperty, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable
Constructors
TextProperty()
Initializes a new instance of the TextProperty class.
Declaration
public TextProperty()
TextProperty(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the TextProperty class.
Declaration
public TextProperty(IEnumerable<KeyValuePair<object, object>> properties)
Parameters
Type | Name | Description |
---|---|---|
System. |
properties | Collection of properties. |
TextProperty(TextProperty)
Initializes a new instance of the Text
Declaration
public TextProperty(TextProperty element)
Parameters
Type | Name | Description |
---|---|---|
Text |
element | The element. |
Properties
ClrDefaultValue
Gets the default valud for the datatype for the property.
Declaration
public override object ClrDefaultValue { get; }
Property Value
Type | Description |
---|---|
System. |
Overrides
DataType
Gets the datatype for the property.
Declaration
public override Type DataType { get; }
Property Value
Type | Description |
---|---|
System. |
Overrides
IsLocalized
Gets or sets a value indicating whether this instance is localized.
Declaration
public bool IsLocalized { get; set; }
Property Value
Type | Description |
---|---|
System. |
|
MaxStorageSize
Gets or sets the maximum storage size of the text property.
Declaration
[SchemaDatabaseMapping(SchemaDatabaseColumn.PropertyLengthPrecision)]
public int MaxStorageSize { get; set; }
Property Value
Type | Description |
---|---|
System. |
Remarks
This property determines the maximum number of characters that can be
stored in the text property. The value has to be between 1 and 4000 or System.
The default value is System.
Exceptions
Type | Condition |
---|---|
System. |
Value is <=0 or >4000 and not System. |
Methods
Convert(Object)
Converts an object to the type of the property.
Declaration
public override object Convert(object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | Object to convert. |
Returns
Type | Description |
---|---|
System. |
Returns the converted object. |
Overrides
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 whether 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 model element, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attached to the model element are validated recursively.
ValidateValue(Object, out String)
Validates that the value is either a string value or null. Additionally verifies that the length of the string is less that Max
Declaration
public override bool ValidateValue(object value, out string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value to verify. |
System. |
errorMessage | The resulting error message, or null if the value is valid. |
Returns
Type | Description |
---|---|
System. |
Returns true if the |