C# 클래스 Habanero.Faces.Base.ControlMapper

A superclass to model a mapper that wraps a control in order to display and capture information for an individual property of a Business Object. Think of the Control Mappers as Binding on Steriods.
상속: IControlMapper
파일 보기 프로젝트 열기: Chillisoft/habanero.faces 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_attributes System.Collections.Hashtable
_businessObject IBusinessObject
_logger IHabaneroLogger

Private Properties

프로퍼티 타입 설명
AddCurrentBOPropHandlers void
AddKeyPressHandlers void
CheckReadWriteRules bool
DoesVirtualPropertyHaveSetter bool
IsPropertyReflective bool
IsPropertyViaRelationship bool
IsTypeOfIControlMapper bool
RemoveCurrentBOPropHandlers void

공개 메소드들

메소드 설명
ApplyChangesToBusinessObject ( ) : void

Updates the properties on the represented business object

BOPropValueUpdatedHandler ( object sender, EventArgs e ) : void

Handler to carry out changes where the value of a business object property has changed

Create ( IControlHabanero ctl, string propertyName ) : IControlMapper

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.

Create ( Type mapperType, IControlHabanero ctl, string propertyName, bool isReadOnly, IControlFactory controlFactory ) : IControlMapper

Create a Control Mapper based on the mapperType

Create ( string mapperTypeName, IControlHabanero ctl, string propertyName ) : IControlMapper

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.

Create ( string mapperTypeName, string mapperAssembly, IControlHabanero ctl, string propertyName, bool isReadOnly, IControlFactory controlFactory ) : IControlMapper

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.

CurrentBOProp ( ) : IBOProp

Returns the IBOProp object being mapped to this control

GetErrorMessage ( ) : string

Returns the Error Provider's Error message.

SetPropertyAttributes ( Hashtable attributes ) : void

A form field can have attributes defined in the class definition. These attributes are passed to the control mapper via a hashtable so that the control mapper can adjust its behaviour accordingly.

UpdateControlValueFromBusinessObject ( ) : void

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject. This also updates the Error Provider with any Error Messages.

UpdateErrorProviderErrorMessage ( ) : void

Sets the Error Provider Error with the appropriate value for the property e.g. if it is invalid then sets the error provider with the invalid reason else sets the error provider with a zero length string.

보호된 메소드들

메소드 설명
ControlMapper ( IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory ) : System

Constructor to instantiate a new instance of the class

GetPropertyValue ( ) : object

Returns the property value of the business object being mapped

InitialiseWithAttributes ( ) : void

Initialises the control using the attributes already provided, using SetPropertyAttributes.

InternalUpdateControlValueFromBo ( ) : void

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject.

IsPropertyVirtual ( ) : bool

is the property a virtual property i.e. is it loaded via reflection or via a relationship.

OnBusinessObjectChanged ( ) : void

An overridable method to provide custom logic to carry out when the business object is changed

SetError ( string errorMessage ) : void
SetPropertyValue ( object value ) : void

Sets the property value to that provided. If the property value is invalid, the error provider will be given the reason why the value is invalid.

UpdateControlVisualState ( bool editable ) : void

Update the Visual state of the control so as to differentiate between Editable and none editable controls.

UpdateIsEditable ( ) : void

Updates the isEditable flag and updates the control according to the current state

비공개 메소드들

메소드 설명
AddCurrentBOPropHandlers ( ) : void
AddKeyPressHandlers ( ) : void
CheckReadWriteRules ( ) : bool
DoesVirtualPropertyHaveSetter ( ) : bool
IsPropertyReflective ( ) : bool
IsPropertyViaRelationship ( ) : bool
IsTypeOfIControlMapper ( Type mapperType ) : bool
RemoveCurrentBOPropHandlers ( ) : void

메소드 상세

ApplyChangesToBusinessObject() 공개 추상적인 메소드

Updates the properties on the represented business object
public abstract ApplyChangesToBusinessObject ( ) : void
리턴 void

BOPropValueUpdatedHandler() 공개 메소드

Handler to carry out changes where the value of a business object property has changed
public BOPropValueUpdatedHandler ( object sender, EventArgs e ) : void
sender object The object that notified of the event
e System.EventArgs Attached arguments regarding the event
리턴 void

ControlMapper() 보호된 메소드

Constructor to instantiate a new instance of the class
protected ControlMapper ( IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory ) : System
ctl IControlHabanero The control object to map
propName string The property name
isReadOnly bool Whether the control is read only. /// If so, it then becomes disabled. If not, /// handlers are assigned to manage key presses.
factory IControlFactory
리턴 System

Create() 공개 정적인 메소드

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.
An exception is /// thrown if the mapperTypeName does not provide a type that is /// a subclass of the ControlMapper class.
public static Create ( IControlHabanero ctl, string propertyName ) : IControlMapper
ctl IControlHabanero The control to be mapped
propertyName string The property name
리턴 IControlMapper

Create() 공개 정적인 메소드

Create a Control Mapper based on the mapperType
public static Create ( Type mapperType, IControlHabanero ctl, string propertyName, bool isReadOnly, IControlFactory controlFactory ) : IControlMapper
mapperType System.Type
ctl IControlHabanero The control to be mapped
propertyName string The property name
isReadOnly bool Whether the control is read-only
controlFactory IControlFactory The control factory that is being set on the Mapper
리턴 IControlMapper

Create() 공개 정적인 메소드

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.
An exception is /// thrown if the mapperTypeName does not provide a type that is /// a subclass of the ControlMapper class.
public static Create ( string mapperTypeName, IControlHabanero ctl, string propertyName ) : IControlMapper
mapperTypeName string The class name of the mapper type /// (e.g. ComboBoxMapper). The current namespace of this /// ControlMapper class will then be prefixed to the name.
ctl IControlHabanero The control to be mapped
propertyName string The property name
리턴 IControlMapper

Create() 공개 정적인 메소드

Creates a new control mapper of a specified type. If no 'mapperTypeName' has been specified, an appropriate mapper for standard controls will be assigned, depending on the type of control.
An exception is /// thrown if the mapperTypeName does not provide a type that is /// a subclass of the ControlMapper class.
public static Create ( string mapperTypeName, string mapperAssembly, IControlHabanero ctl, string propertyName, bool isReadOnly, IControlFactory controlFactory ) : IControlMapper
mapperTypeName string The class name of the mapper type /// (e.g. ComboBoxMapper). The current namespace of this /// ControlMapper class will then be prefixed to the name.
mapperAssembly string The assembly where the mapper is /// located
ctl IControlHabanero The control to be mapped
propertyName string The property name
isReadOnly bool Whether the control is read-only
controlFactory IControlFactory The control factory
리턴 IControlMapper

CurrentBOProp() 공개 메소드

Returns the IBOProp object being mapped to this control
public CurrentBOProp ( ) : IBOProp
리턴 IBOProp

GetErrorMessage() 공개 메소드

Returns the Error Provider's Error message.
public GetErrorMessage ( ) : string
리턴 string

GetPropertyValue() 보호된 메소드

Returns the property value of the business object being mapped
protected GetPropertyValue ( ) : object
리턴 object

InitialiseWithAttributes() 보호된 메소드

Initialises the control using the attributes already provided, using SetPropertyAttributes.
protected InitialiseWithAttributes ( ) : void
리턴 void

InternalUpdateControlValueFromBo() 보호된 추상적인 메소드

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject.
protected abstract InternalUpdateControlValueFromBo ( ) : void
리턴 void

IsPropertyVirtual() 보호된 메소드

is the property a virtual property i.e. is it loaded via reflection or via a relationship.
protected IsPropertyVirtual ( ) : bool
리턴 bool

OnBusinessObjectChanged() 보호된 메소드

An overridable method to provide custom logic to carry out when the business object is changed
protected OnBusinessObjectChanged ( ) : void
리턴 void

SetError() 보호된 메소드

protected SetError ( string errorMessage ) : void
errorMessage string
리턴 void

SetPropertyAttributes() 공개 메소드

A form field can have attributes defined in the class definition. These attributes are passed to the control mapper via a hashtable so that the control mapper can adjust its behaviour accordingly.
public SetPropertyAttributes ( Hashtable attributes ) : void
attributes System.Collections.Hashtable A hashtable of attributes, which consists /// of name-value pairs, where name is the attribute name. This is usually /// set in the XML definitions for the class's user interface.
리턴 void

SetPropertyValue() 보호된 메소드

Sets the property value to that provided. If the property value is invalid, the error provider will be given the reason why the value is invalid.
protected SetPropertyValue ( object value ) : void
value object
리턴 void

UpdateControlValueFromBusinessObject() 공개 메소드

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject. This also updates the Error Provider with any Error Messages.
public UpdateControlValueFromBusinessObject ( ) : void
리턴 void

UpdateControlVisualState() 보호된 메소드

Update the Visual state of the control so as to differentiate between Editable and none editable controls.
protected UpdateControlVisualState ( bool editable ) : void
editable bool
리턴 void

UpdateErrorProviderErrorMessage() 공개 메소드

Sets the Error Provider Error with the appropriate value for the property e.g. if it is invalid then sets the error provider with the invalid reason else sets the error provider with a zero length string.
public UpdateErrorProviderErrorMessage ( ) : void
리턴 void

UpdateIsEditable() 보호된 메소드

Updates the isEditable flag and updates the control according to the current state
protected UpdateIsEditable ( ) : void
리턴 void

프로퍼티 상세

_attributes 보호되어 있는 프로퍼티

A Hash table of additional Attributes available for this Control Mapper e.g. for DateTimePickerMapper may have date format
protected Hashtable,System.Collections _attributes
리턴 System.Collections.Hashtable

_businessObject 보호되어 있는 프로퍼티

The Business Object being mapped
protected IBusinessObject _businessObject
리턴 IBusinessObject

_logger 보호되어 있는 정적으로 프로퍼티

the ILog used to log any messages for this class or its children
protected static IHabaneroLogger _logger
리턴 IHabaneroLogger