Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ReflectionUtils.CreateCustomAttribute(Type, Object, Attribute) Method

Creates a CustomAttributeBuilder.

[Visual Basic]
Public Overloads Shared Sub CreateCustomAttribute( _
   ByVal type As Type, _
   ByVal ctorArgs As Object, _
   ByVal sourceAttribute As Attribute _
public static CustomAttributeBuilder CreateCustomAttribute(
   Type type,
   object[] ctorArgs,
   Attribute sourceAttribute


The desired AttributeType.
Any constructor arguments for the attribute (may be a null reference (Nothing in Visual Basic) in the case of no arguments).
Source attribute to copy properties from (may be a null reference (Nothing in Visual Basic)).

Return Value

A custom attribute builder.


Note that if a non-a null reference (Nothing in Visual Basic)sourceAttribute is supplied, any read write properties exposed by the sourceAttribute will be used to overwrite values that may have been passed in via the ctorArgs. That is, the ctorArgs will be used to initialize the custom attribute, and then any read-write properties on the sourceAttribute will be plugged in.


Exception Type Condition
ArgumentNullException If the type parameter is a null reference (Nothing in Visual Basic).
ArgumentNullException If the type parameter is not a Type that derives from the Attribute class.

See Also

ReflectionUtils Class | Spring.Util Namespace | ReflectionUtils.CreateCustomAttribute Overload List | CustomAttributeBuilder