DataProperty

DataProperty implements IDataProperty as an Attribute, and it's the base class for those that implements specific data property functionality.

Namespace:
Inetdev.Data
Type:
Class
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
Yes
Inherits from:
System.Attribute
Implements:
Inetdev.Data.IDataProperty

Constructors

DataProperty

Creates a new instance of DataProperty.

Signature:
public Void DataProperty(name, type)
Parameters
Name Type Summary
name String The name of the property.
type DbType The type of the property.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.

Properties

AutomaticType

Gets or sets the automatic type for the property.

Signature:
public AutomaticType AutomaticType { get; set; }

Caption

Get or sets the caption for the property.

Signature:
public String Caption { get; set; }

DefaultValue

Gets or sets the default value for the property.

Signature:
public Object DefaultValue { get; set; }

FieldName

Gets or sets the name of the internal field that holds the property value.

Signature:
public String FieldName { get; set; }

HasData

Gets or sets if the data property has data.

Signature:
public Boolean HasData { get; set; }

Hint

Gets or sets a hint message.

Signature:
public String Hint { get; set; }

InvalidContentMessage

Gets or set a message to be shown when the property content is invalid.

Signature:
public String InvalidContentMessage { get; set; }

IsModified

Gets or sets if the data property has been modified.

Signature:
public Boolean IsModified { get; set; }

IsPrimaryKey

Gets whether this property is part of the primary key.

Signature:
public Boolean IsPrimaryKey { get; }

Mandatory

Gets or sets whether the property is mandatory.

Signature:
public Boolean Mandatory { get; set; }

Name

Gets or sets the name of the property.

Signature:
public String Name { get; set; }

OmitSetDataPropertyValue

Gets or sets whether the default SetDataPropertyValue method must be omitted.

Signature:
public Boolean OmitSetDataPropertyValue { get; set; }

PrimaryKey

Gets or sets the position of the property in the object primary key.

Signature:
public Int32 PrimaryKey { get; set; }

Protection

Gets or sets the protection applied to the property.

Signature:
public ProtectionType Protection { get; set; }

RequiredMessage

Gets or sets the message to show when a mandatory property was not provided.

Signature:
public String RequiredMessage { get; set; }

ResourceType

Gets or sets the Type of the resource used for localization.

Signature:
public Type ResourceType { get; set; }

Type

Gets the data type of the property.

Signature:
public DbType Type { get; set; }

Methods

ClearState

Clears the state of the property.

Signature:
public Void ClearState(value)
Parameters
Name Type Summary
value Object The value that the data property field contains.

GetLocalizedMessage

Gets the localized message for the specified resource name.

Signature:
protected String GetLocalizedMessage(name)
Returns

A localized message or name.

Parameters
Name Type Summary
name String Resource name.

SetState

Sets the state of the property.

Signature:
public Void SetState(value)
Parameters
Name Type Summary
value Object The value that the data property field contains.

ShouldValidate

Indicates whether the property should be validated or not.

Signature:
public Boolean ShouldValidate(action)
Returns

true if the property should be validated, otherwise false.

Parameters
Name Type Summary
action DataAction The current action.

Validate

Validates the specified value to see if it is a valid value for the property.

Signature:
public Void Validate(value, action)
Remarks

Throwns validation exceptions if the value is not valid.

Parameters
Name Type Summary
value Object The value to validate.
action DataAction The current action that is performing.