Export (0) Print
Expand All

PropertyBuilder.SetCustomAttribute Method

Applies a custom attribute by using a custom attribute builder.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

[SecuritySafeCriticalAttribute]
public void SetCustomAttribute(
	CustomAttributeBuilder customBuilder
)

Parameters

customBuilder
Type: System.Reflection.Emit.CustomAttributeBuilder
An instance of a helper class that defines the custom attribute to apply.

ExceptionCondition
ArgumentNullException

customBuilder is null.

InvalidOperationException

CreateType has been called on the enclosing type.

For an example of applying a custom attribute, see the SetCustomAttribute(CustomAttributeBuilder) method overload.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft