Table of Contents

Class DefaultMemberAttribute

Namespace
System.Reflection
Assembly
mscorlib.dll

Defines the member of a type that is the default member used by InvokeMember.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Interface)]
public sealed class DefaultMemberAttribute : Attribute
Inheritance
DefaultMemberAttribute
Inherited Members
Extension Methods

Remarks

Available only in mscorlib build with support for System.Reflection.

Constructors

DefaultMemberAttribute(string)

Initializes a new instance of the DefaultMemberAttribute class.

public DefaultMemberAttribute(string memberName)

Parameters

memberName string

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.

public string MemberName { get; }

Property Value

string

A string representing the member name.