CustomAttributeNamedArgument.TypedValue Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets a CustomAttributeTypedArgument structure that can be used to obtain the type and value of the current named argument.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Reflection.CustomAttributeTypedArgumentA structure that can be used to obtain the type and value of the current named argument.
The CustomAttributeNamedArgument structure only contains information about how the argument value was set. Use this property to obtain a CustomAttributeTypedArgument structure that contains the type and value.
The following code example defines a custom attribute with four constructors and four properties. Two of the properties are read-only, and are set by using the positional parameters of the constructors. The other two properties are read/write, and can be set only by using named arguments. One positional property is an array of strings, and one named property is an array of integers.
The attribute is applied to the assembly, to a type declared in the assembly, to a method of the type, and to a parameter of the method. Different constructors are used for these cases. When executed, the assembly loads itself into the reflection-only context and displays the custom attributes.
The attribute that is applied to the type demonstrates array properties, with both positional and named arguments.
The TypedValue property is used in the ShowAttributeData method that displays custom attribute data, to obtain the types and values of named attributes.