C# Class System.Xml.Xsl.Runtime.XmlExtensionFunction

This internal class contains methods that allow binding to extension functions and invoking them.
Mostra file Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Public Methods

Method Description
Bind ( ) : void

Bind to the CLR type specified in the Init() call. If a matching method cannot be found, throw an exception.

CanBind ( ) : bool

Return true if the CLR type specified in the Init() call has a matching method.

Equals ( object other ) : bool

Return true if this XmlExtensionFunction has the same values as another XmlExtensionFunction.

GetClrArgumentType ( int index ) : Type

Once Bind has been successfully called, the Clr type of each argument can be accessed. Note that this may be different than Method.GetParameterInfo().ParameterType.

GetHashCode ( ) : int

Return this object's hash code, previously computed for performance.

GetXmlArgumentType ( int index ) : XmlQueryType

Once Bind has been successfully called, the inferred Xml types of the arguments can be accessed.

Init ( string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags ) : void

Initialize, but do not bind.

Invoke ( object extObj, object args ) : object

Convert the incoming arguments to an array of CLR objects, and then invoke the external function on the "extObj" object instance.

XmlExtensionFunction ( ) : System

Constructor.

XmlExtensionFunction ( string name, string namespaceUri, MethodInfo meth ) : System

Constructor (directly binds to passed MethodInfo).

XmlExtensionFunction ( string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags ) : System

Constructor.

Private Methods

Method Description
Bind ( MethodInfo meth ) : void

Bind to the specified MethodInfo.

GetClrType ( Type clrType ) : Type

1. Map enumerations to the underlying integral type. 2. Throw an exception if the type is ByRef

InferXmlType ( Type clrType ) : XmlQueryType

Infer an Xml type from a Clr type using Xslt infererence rules

Method Details

Bind() public method

Bind to the CLR type specified in the Init() call. If a matching method cannot be found, throw an exception.
public Bind ( ) : void
return void

CanBind() public method

Return true if the CLR type specified in the Init() call has a matching method.
public CanBind ( ) : bool
return bool

Equals() public method

Return true if this XmlExtensionFunction has the same values as another XmlExtensionFunction.
public Equals ( object other ) : bool
other object
return bool

GetClrArgumentType() public method

Once Bind has been successfully called, the Clr type of each argument can be accessed. Note that this may be different than Method.GetParameterInfo().ParameterType.
public GetClrArgumentType ( int index ) : Type
index int
return System.Type

GetHashCode() public method

Return this object's hash code, previously computed for performance.
public GetHashCode ( ) : int
return int

GetXmlArgumentType() public method

Once Bind has been successfully called, the inferred Xml types of the arguments can be accessed.
public GetXmlArgumentType ( int index ) : XmlQueryType
index int
return XmlQueryType

Init() public method

Initialize, but do not bind.
public Init ( string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags ) : void
name string
namespaceUri string
numArgs int
objectType System.Type
flags BindingFlags
return void

Invoke() public method

Convert the incoming arguments to an array of CLR objects, and then invoke the external function on the "extObj" object instance.
public Invoke ( object extObj, object args ) : object
extObj object
args object
return object

XmlExtensionFunction() public method

Constructor.
public XmlExtensionFunction ( ) : System
return System

XmlExtensionFunction() public method

Constructor (directly binds to passed MethodInfo).
public XmlExtensionFunction ( string name, string namespaceUri, MethodInfo meth ) : System
name string
namespaceUri string
meth System.Reflection.MethodInfo
return System

XmlExtensionFunction() public method

Constructor.
public XmlExtensionFunction ( string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags ) : System
name string
namespaceUri string
numArgs int
objectType System.Type
flags BindingFlags
return System