Class DefaultMemberAttribute
Defines the member of a type that is the default member used by InvokeMember.
Inherited Members
Namespace: System.Reflection
Assembly: mscorlib.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Interface)]
public sealed class DefaultMemberAttribute : Attribute
Remarks
Available only in mscorlib build with support for System.Reflection.
Constructors
DefaultMemberAttribute(string)
Initializes a new instance of the DefaultMemberAttribute class.
Declaration
public DefaultMemberAttribute(string memberName)
Parameters
Type | Name | Description |
---|---|---|
string | memberName | A String containing the name of the member to invoke. This may be a constructor, method, property, or field. A suitable invocation attribute must be specified when the member is invoked. The default member of a class can be specified by passing an empty String as the name of the member. |
Properties
MemberName
Gets the name from the attribute.
Declaration
public string MemberName { get; }
Property Value
Type | Description |
---|---|
string | A string representing the member name. |