System.Reflection.DefaultMemberAttribute Class

public sealed class DefaultMemberAttribute : Attribute

Base Types

Object
  Attribute
    DefaultMemberAttribute

Assembly

mscorlib

Library

RuntimeInfrastructure

Summary

Defines the member that is invoked when no member name is specified for the type targeted by DefaultMemberAttribute .

Description

[Note: This attribute is used by the System.Type.InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[]) methods.

This attribute can be applied to classes, structs, and interfaces.

]

Attributes

AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple=false, Inherited=true)

See Also

System.Reflection Namespace

Members

DefaultMemberAttribute Constructors

DefaultMemberAttribute Constructor

DefaultMemberAttribute Properties

DefaultMemberAttribute.MemberName Property


DefaultMemberAttribute Constructor

public DefaultMemberAttribute(string memberName);

Summary

Constructs and initializes new instance of the DefaultMemberAttribute class.

Parameters

memberName
A String containing the name of the member to invoke. Can be a constructor, method, property, or field.

Description

This constructor initializes the System.Reflection.DefaultMemberAttribute.MemberName property using memberName .

See Also

System.Reflection.DefaultMemberAttribute Class, System.Reflection Namespace

DefaultMemberAttribute.MemberName Property

public string MemberName { get; }

Summary

Gets the member name contained by the current instance.

Property Value

A String representing the member name contained by the current instance.

Description

This property is read-only.

See Also

System.Reflection.DefaultMemberAttribute Class, System.Reflection Namespace