3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 ////////////////////////////////////////////////////////////////////////////////
7 ////////////////////////////////////////////////////////////////////////////////
9 // DefaultMemberAttribute is defines the Member of a Type that is the "default"
11 // <OWNER>Microsoft</OWNER>
12 // member used by Type.InvokeMember. The default member is simply a name given
18 namespace System
.Reflection
{
23 [AttributeUsage(AttributeTargets
.Class
| AttributeTargets
.Struct
| AttributeTargets
.Interface
)]
24 [System
.Runtime
.InteropServices
.ComVisible(true)]
25 public sealed class DefaultMemberAttribute
: Attribute
27 // The name of the member
28 private String m_memberName
;
30 // You must provide the name of the member, this is required
31 public DefaultMemberAttribute(String memberName
) {
32 m_memberName
= memberName
;
35 // A get accessor to return the name from the attribute.
36 // NOTE: There is no setter because the name must be provided
37 // to the constructor. The name is not optional.
38 public String MemberName
{
39 get {return m_memberName;}