CustomAttributeHelper.ConstructRuntimeObject Method (IAnnotationValue, Type) |
Namespace: PostSharp.Sdk.CodeModel
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
public static Object ConstructRuntimeObject( this IAnnotationValue attribute, Type instanceType )
Parameters
- attribute
- Type: PostSharp.Sdk.CodeModel.IAnnotationValue
Custom attribute to be constructed. - instanceType
- Type: System.Type
Type of the custom attribute.
Return Value
Type: ObjectA new instance (typically derived from Attribute) constructed on by the constructor represented by the Constructor property and based on the values given in ConstructorArguments and NamedArguments.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IAnnotationValue. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exception | Condition |
---|---|
CustomAttributeConstructorException | The constructor or a property setter threw an exception. |