C# Класс Habanero.BO.BOProp

Stores the values (current Value, DatabaseValue etc) and state (dirty, valid) of a property of a IBusinessObject. Has a reference to the Property Definition PropDef that was used to create it. The Property definition includes property rules and validation functionality. The property of a business object may represent a property such as FirstName, Surname. Typically a IBusinessObject will have a collection of Properties.
Наследование: IBOProp
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_currentValue object
_invalidReason string
_isDirty bool
_isObjectNew bool
_isValid bool
_logger IHabaneroLogger
_origInvalidReason string
_origValueIsValid bool
_persistedValue object
_propDef IPropDef
_valueBeforeLastEdit object

Открытые методы

Метод Описание
BOProp ( IPropDef propDef ) : System

Constructor to initialise a new property

BOProp ( IPropDef propDef, object propValue ) : System

Constructor to initialise a new property with a specific value

BackupPropValue ( ) : void

Copies the current property value to PersistedValue. This is usually called when the object is persisted to the database.

CurrentValueEquals ( object value ) : bool

Is the value equal to the current Value of the BOProp.

InitialiseProp ( object propValue ) : bool

Initialises the property with the specified value

IsEditable ( string &message ) : bool

Returns whether the BOProperty is Editable or not. The BOProp may not be editable based on a number of factors. 1) If its ReadWrite Rules are set to ReadOnly etc. 2) The user may not have permissions to edit this property Value.

IsReadable ( string &message ) : bool

Returns whether the BOProperty is Readable or not. The BOProp may not be Readable if the user may not have permissions to read the property Value.

ParsePropValue ( object valueToParse, object &returnValue ) : void

This method provides a the functionality to convert any object to the appropriate type for the particular BOProp Type. e.g it will convert a valid guid string to a valid Guid Object.

RestorePropValue ( ) : void

Restores the property's original value as defined in PersistedValue

SetAuthorisationRules ( IBOPropAuthorisation boPropAuthorisation ) : void

Set the authorisation rule strategy to be used

Validate ( ) : void

Validates whether the property values set for the BOProp are valid as compared to the BOProp rules. This is used by the Business Object Validate Method.

Защищенные методы

Метод Описание
FireBOPropValueUpdated ( ) : void

Fires an Updated event

InitialiseProp ( object propValue, bool isObjectNew ) : bool

Initialises the property with the specified value, and indicates whether the object is new or not

IsReadable ( ) : bool

Are there any authorisation rules preventing this property from being read.

RaiseIncorrectTypeException ( object value ) : void

Raises an Erorr if the Incorrect type of property is being set to this BOProp.

Приватные методы

Метод Описание
AreReadWriteRulesEditable ( string &message ) : bool
CompareValues ( object compareToValue, object value ) : bool
FormatForXML ( string text ) : string
PersistedValueEquals ( object value ) : bool

Is the value equal to the persisted Value of the BOProp.

Описание методов

BOProp() публичный Метод

Constructor to initialise a new property
public BOProp ( IPropDef propDef ) : System
propDef IPropDef The property definition
Результат System

BOProp() публичный Метод

Constructor to initialise a new property with a specific value
public BOProp ( IPropDef propDef, object propValue ) : System
propDef IPropDef The property definition
propValue object The initial value
Результат System

BackupPropValue() публичный Метод

Copies the current property value to PersistedValue. This is usually called when the object is persisted to the database.
public BackupPropValue ( ) : void
Результат void

CurrentValueEquals() публичный Метод

Is the value equal to the current Value of the BOProp.
public CurrentValueEquals ( object value ) : bool
value object
Результат bool

FireBOPropValueUpdated() защищенный Метод

Fires an Updated event
protected FireBOPropValueUpdated ( ) : void
Результат void

InitialiseProp() публичный Метод

Initialises the property with the specified value
public InitialiseProp ( object propValue ) : bool
propValue object The value to assign
Результат bool

InitialiseProp() защищенный Метод

Initialises the property with the specified value, and indicates whether the object is new or not
protected InitialiseProp ( object propValue, bool isObjectNew ) : bool
propValue object The value to assign
isObjectNew bool Whether the object is new or not
Результат bool

IsEditable() публичный Метод

Returns whether the BOProperty is Editable or not. The BOProp may not be editable based on a number of factors. 1) If its ReadWrite Rules are set to ReadOnly etc. 2) The user may not have permissions to edit this property Value.
public IsEditable ( string &message ) : bool
message string
Результат bool

IsReadable() защищенный Метод

Are there any authorisation rules preventing this property from being read.
protected IsReadable ( ) : bool
Результат bool

IsReadable() публичный Метод

Returns whether the BOProperty is Readable or not. The BOProp may not be Readable if the user may not have permissions to read the property Value.
public IsReadable ( string &message ) : bool
message string the reason why the user cannot read the property.
Результат bool

ParsePropValue() публичный Метод

This method provides a the functionality to convert any object to the appropriate type for the particular BOProp Type. e.g it will convert a valid guid string to a valid Guid Object.
public ParsePropValue ( object valueToParse, object &returnValue ) : void
valueToParse object The value to be converted
returnValue object The value that has been parsed
Результат void

RaiseIncorrectTypeException() защищенный Метод

Raises an Erorr if the Incorrect type of property is being set to this BOProp.
protected RaiseIncorrectTypeException ( object value ) : void
value object
Результат void

RestorePropValue() публичный Метод

Restores the property's original value as defined in PersistedValue
public RestorePropValue ( ) : void
Результат void

SetAuthorisationRules() публичный Метод

Set the authorisation rule strategy to be used
public SetAuthorisationRules ( IBOPropAuthorisation boPropAuthorisation ) : void
boPropAuthorisation IBOPropAuthorisation
Результат void

Validate() публичный Метод

Validates whether the property values set for the BOProp are valid as compared to the BOProp rules. This is used by the Business Object Validate Method.
public Validate ( ) : void
Результат void

Описание свойств

_currentValue защищенное свойство

The current value of the BOProp
protected object _currentValue
Результат object

_invalidReason защищенное свойство

The reason the prop is invalid
protected string _invalidReason
Результат string

_isDirty защищенное свойство

Whether the prop has been edited since being created or loaded from the database
protected bool _isDirty
Результат bool

_isObjectNew защищенное свойство

Is the business object new.
protected bool _isObjectNew
Результат bool

_isValid защищенное свойство

Is the boProp valid
protected bool _isValid
Результат bool

_logger защищенное статическое свойство

The Logger
protected static IHabaneroLogger _logger
Результат IHabaneroLogger

_origInvalidReason защищенное свойство

The reason that the origional value was not valid.
protected string _origInvalidReason
Результат string

_origValueIsValid защищенное свойство

Whether the origional value loaded from the DB or the default value was valid.
protected bool _origValueIsValid
Результат bool

_persistedValue защищенное свойство

The persisted value of the Property.
protected object _persistedValue
Результат object

_propDef защищенное свойство

The propDef for the BOProp
protected IPropDef _propDef
Результат IPropDef

_valueBeforeLastEdit защищенное свойство

The value prior to the last edit.
protected object _valueBeforeLastEdit
Результат object