C# Class Castle.Components.Binder.DataBinder

Inheritance: System.MarshalByRefObject, IDataBinder, IServiceEnabledComponent
Afficher le fichier Open project: nats/castle-1.0.3-mono Class Usage Examples

Protected Properties

Свойство Type Description
PropertiesBindingFlags BindingFlags
errors IList

Méthodes publiques

Méthode Description
BindObject ( Type targetType, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : object
BindObject ( Type targetType, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : object
BindObjectInstance ( object instance, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : void
BindObjectInstance ( object instance, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : void
BindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : object
CanBindObject ( Type targetType, String prefix, Castle.Components.Binder.CompositeNode treeRoot ) : bool
CanBindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : bool
DataBinder ( ) : System

Initializes a new instance of the DataBinder class.

GetValidationSummary ( object instance ) : ErrorSummary

Gets the validation error summary.

Service ( IServiceProvider provider ) : void

Méthodes protégées

Méthode Description
AfterBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
BeforeBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
BeforeBindingProperty ( object instance, PropertyInfo prop, string prefix, Castle.Components.Binder.CompositeNode node ) : void
BindSpecialObjectInstance ( Type instanceType, String prefix, Castle.Components.Binder.Node node, bool &succeeded ) : object

Implementations will bound the instance itself. IsSpecialType

IsSpecialType

CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, Castle.Components.Binder.CompositeNode node, string name, string prefix, ErrorSummary summary ) : bool
CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, object value, string name, string prefix, ErrorSummary summary ) : bool
ConvertLeafNode ( Type desiredType, Castle.Components.Binder.LeafNode lNode, bool &conversionSucceeded ) : object
CreateInstance ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
CreateNormalizedList ( String csv ) : String[]
InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.CompositeNode node ) : void
InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
IsSpecialType ( Type instanceType ) : bool

Invoked during object binding to allow subclasses to have a chance of binding the types itself. If the implementation returns true the binder will invoke BindSpecialObjectInstance

PerformCustomBinding ( object instance, string prefix, Castle.Components.Binder.Node node ) : bool
PopInstance ( object instance, string prefix ) : void
PushInstance ( object instance, string prefix ) : void
SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void

Sets the property value of the object we are binding. Databinders that require different ways to access properties can override this method.

ShouldIgnoreType ( Type instanceType ) : bool
ShouldRecreateInstance ( object value, Type type, String prefix, Castle.Components.Binder.Node node ) : bool

Private Methods

Méthode Description
ConvertComplexNodesToArray ( Type desiredType, Castle.Components.Binder.IndexedNode parent, bool &conversionSucceeded ) : object
ConvertComplexNodesToList ( Type elemType, Castle.Components.Binder.IndexedNode parent, bool &conversionSucceeded ) : ArrayList
ConvertFlatNodesToArray ( Type desiredType, Castle.Components.Binder.Node nodes, bool &conversionSucceeded ) : object
ConvertFlatNodesToList ( Type elemType, Castle.Components.Binder.Node nodes, bool &conversionSucceeded ) : ArrayList
ConvertToArray ( Type desiredType, String key, Castle.Components.Binder.Node node, bool &conversionSucceeded ) : object
ConvertToGenericList ( Type desiredType, String key, Castle.Components.Binder.Node node, bool &conversionSucceeded ) : object
ConvertToSimpleValue ( Type desiredType, string key, Castle.Components.Binder.CompositeNode parent, bool &conversionSucceeded ) : object
InternalBindGenericList ( Type instanceType, string paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
InternalBindObjectArray ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
IsDateTimeType ( Type desiredType ) : bool
IsGenericList ( Type instanceType ) : bool
IsSimpleProperty ( Type propType ) : bool
NormalizeList ( String list ) : void
RelaxedConvertLeafNode ( Type desiredType, Castle.Components.Binder.Node node, object defaultValue ) : object
ShouldIgnoreProperty ( PropertyInfo prop, string nodeFullName ) : bool
Translate ( Type instanceType, string paramName ) : string
TryGetDateWithUTCFormat ( Castle.Components.Binder.CompositeNode treeRoot, string paramName, bool &conversionSucceeded ) : string
TrySpecialDateTimeBinding ( Type desiredType, Castle.Components.Binder.CompositeNode treeRoot, String paramName, bool &conversionSucceeded ) : object

Method Details

AfterBinding() protected méthode

protected AfterBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
Résultat void

BeforeBinding() protected méthode

protected BeforeBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
Résultat void

BeforeBindingProperty() protected méthode

protected BeforeBindingProperty ( object instance, PropertyInfo prop, string prefix, Castle.Components.Binder.CompositeNode node ) : void
instance object
prop System.Reflection.PropertyInfo
prefix string
node Castle.Components.Binder.CompositeNode
Résultat void

BindObject() public méthode

public BindObject ( Type targetType, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : object
targetType System.Type
prefix string
treeRoot Castle.Components.Binder.CompositeNode
Résultat object

BindObject() public méthode

public BindObject ( Type targetType, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : object
targetType System.Type
prefix string
excludedProperties string
allowedProperties string
treeRoot Castle.Components.Binder.CompositeNode
Résultat object

BindObjectInstance() public méthode

public BindObjectInstance ( object instance, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : void
instance object
prefix string
treeRoot Castle.Components.Binder.CompositeNode
Résultat void

BindObjectInstance() public méthode

public BindObjectInstance ( object instance, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : void
instance object
prefix string
excludedProperties string
allowedProperties string
treeRoot Castle.Components.Binder.CompositeNode
Résultat void

BindParameter() public méthode

public BindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : object
desiredType System.Type
paramName String
treeRoot Castle.Components.Binder.CompositeNode
Résultat object

BindSpecialObjectInstance() protected méthode

Implementations will bound the instance itself. IsSpecialType
IsSpecialType
protected BindSpecialObjectInstance ( Type instanceType, String prefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
instanceType System.Type
prefix String
node Castle.Components.Binder.Node
succeeded bool
Résultat object

CanBindObject() public méthode

public CanBindObject ( Type targetType, String prefix, Castle.Components.Binder.CompositeNode treeRoot ) : bool
targetType System.Type
prefix String
treeRoot Castle.Components.Binder.CompositeNode
Résultat bool

CanBindParameter() public méthode

public CanBindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : bool
desiredType System.Type
paramName String
treeRoot Castle.Components.Binder.CompositeNode
Résultat bool

CheckForValidationFailures() protected méthode

protected CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, Castle.Components.Binder.CompositeNode node, string name, string prefix, ErrorSummary summary ) : bool
instance object
instanceType System.Type
prop System.Reflection.PropertyInfo
node Castle.Components.Binder.CompositeNode
name string
prefix string
summary Castle.Components.Validator.ErrorSummary
Résultat bool

CheckForValidationFailures() protected méthode

protected CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, object value, string name, string prefix, ErrorSummary summary ) : bool
instance object
instanceType System.Type
prop System.Reflection.PropertyInfo
value object
name string
prefix string
summary Castle.Components.Validator.ErrorSummary
Résultat bool

ConvertLeafNode() protected méthode

protected ConvertLeafNode ( Type desiredType, Castle.Components.Binder.LeafNode lNode, bool &conversionSucceeded ) : object
desiredType System.Type
lNode Castle.Components.Binder.LeafNode
conversionSucceeded bool
Résultat object

CreateInstance() protected méthode

protected CreateInstance ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
instanceType System.Type
paramPrefix String
node Castle.Components.Binder.Node
Résultat object

CreateNormalizedList() protected méthode

protected CreateNormalizedList ( String csv ) : String[]
csv String
Résultat String[]

DataBinder() public méthode

Initializes a new instance of the DataBinder class.
public DataBinder ( ) : System
Résultat System

GetValidationSummary() public méthode

Gets the validation error summary.
public GetValidationSummary ( object instance ) : ErrorSummary
instance object The instance.
Résultat Castle.Components.Validator.ErrorSummary

InternalBindObject() protected méthode

protected InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
instanceType System.Type
paramPrefix String
node Castle.Components.Binder.Node
Résultat object

InternalBindObject() protected méthode

protected InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
instanceType System.Type
paramPrefix String
node Castle.Components.Binder.Node
succeeded bool
Résultat object

InternalRecursiveBindObjectInstance() protected méthode

protected InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.CompositeNode node ) : void
instance object
prefix String
node Castle.Components.Binder.CompositeNode
Résultat void

InternalRecursiveBindObjectInstance() protected méthode

protected InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
Résultat void

IsSpecialType() protected méthode

Invoked during object binding to allow subclasses to have a chance of binding the types itself. If the implementation returns true the binder will invoke BindSpecialObjectInstance
protected IsSpecialType ( Type instanceType ) : bool
instanceType System.Type Type about to be bound
Résultat bool

PerformCustomBinding() protected méthode

protected PerformCustomBinding ( object instance, string prefix, Castle.Components.Binder.Node node ) : bool
instance object
prefix string
node Castle.Components.Binder.Node
Résultat bool

PopInstance() protected méthode

protected PopInstance ( object instance, string prefix ) : void
instance object
prefix string
Résultat void

PushInstance() protected méthode

protected PushInstance ( object instance, string prefix ) : void
instance object
prefix string
Résultat void

Service() public méthode

public Service ( IServiceProvider provider ) : void
provider IServiceProvider
Résultat void

SetPropertyValue() protected méthode

Sets the property value of the object we are binding. Databinders that require different ways to access properties can override this method.
protected SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void
instance object
prop System.Reflection.PropertyInfo
value object
Résultat void

ShouldIgnoreType() protected méthode

protected ShouldIgnoreType ( Type instanceType ) : bool
instanceType System.Type
Résultat bool

ShouldRecreateInstance() protected méthode

protected ShouldRecreateInstance ( object value, Type type, String prefix, Castle.Components.Binder.Node node ) : bool
value object
type System.Type
prefix String
node Castle.Components.Binder.Node
Résultat bool

Property Details

PropertiesBindingFlags protected_oe static_oe property

protected static BindingFlags PropertiesBindingFlags
Résultat BindingFlags

errors protected_oe property

Collect the databind errors
protected IList errors
Résultat IList