Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

IProxyTypeBuilder.TypeAttributes Property

The list of custom Attributes that the proxy class must be decorated with.

[Visual Basic]
Public MustOverride Property TypeAttributes() As IList
   Public Get
   End Get
   Public Set
   End Set
End Property
public IList TypeAttributes { public get; public set; }


Note that the list is composed of instances of the actual Attributes that are to be applied, not the Attributes of the Types.


The following code snippets show examples of how to decorate the the proxied class with one or more Attributes.

// get a concrete implementation of an IProxyTypeBuilder...
IProxyTypeBuilder builder = ... ;
builder.TargetType = typeof( ... );

IDictionary typeAtts = new Hashtable();
builder.TypeAttributes = typeAtts;

// applies a single Attribute to the proxied class...
typeAtts = new Attribute[] { new MyCustomAttribute() });

// applies a number of Attributes to the proxied class...
typeAtts = new Attribute[]
        new MyCustomAttribute(),
        new AnotherAttribute(),

See Also

IProxyTypeBuilder Interface | Spring.Proxy Namespace