Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

IProxyTypeBuilder.MemberAttributes Property

The custom Attributes that the proxy members must be decorated with.

[Visual Basic]
Public MustOverride Property MemberAttributes() As IDictionary
   Public Get
   End Get
   Public Set
   End Set
End Property
[C#]
public IDictionary MemberAttributes { public get; public set; }

Remarks

This dictionary must use simple Strings for keys (denoting the member names that the attributes are to be applied to), with the corresponding values being ILists.

The key may be wildcarded using the '*' character... if so, then those proxy members that match against the key will be decorated with the attendant list of Attributes. This naturally implies that using the '*' character as a key will result in the attendant list of Attributes being applied to every member of the proxied class.

Example

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

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

IDictionary memAtts = new Hashtable();
builder.MemberAttributes = memAtts;

// applies a single Attribute to all members of the proxied class...
memAtts ["*"] = new Attribute[] { new MyCustomAttribute() });

// applies a number of Attributes to all members of the proxied class...
memAtts ["*"] = new Attribute[]
    {
        new MyCustomAttribute(),
        new AnotherAttribute(),
    });

// applies a single Attribute to those members of the proxied class
//     that have identifiers starting with 'Do' ...
memAtts ["Do*"] = new Attribute[] { new MyCustomAttribute() });

// applies a number of Attributes to those members of the proxied class
//     that have identifiers starting with 'Do' ...
memAtts ["Do*"] = new Attribute[]
    {
        new MyCustomAttribute(),
        new AnotherAttribute(),
    }); 

See Also

IProxyTypeBuilder Interface | Spring.Proxy Namespace