System.Reflection.DefaultMemberAttribute Class

Defines the member of a type that is the default member used by Type.InvokeMember(string, BindingFlags, Binder, object, Object[], ParameterModifier[], System.Globalization.CultureInfo, String[]).

See Also: DefaultMemberAttribute Members


[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Interface | System.AttributeTargets.All)]
public sealed class DefaultMemberAttribute : Attribute


A property is imported as an indexer (default indexed property in Visual Basic) if the property has arguments and if the name of the property or one of its accessors matches the name specified by the System.Reflection.DefaultMemberAttribute. If the System.Reflection.DefaultMemberAttribute is not present on the containing type, then the type does not have an indexer. The C# compiler emits the System.Reflection.DefaultMemberAttribute on any type containing an indexer. In C# it is an error to manually attribute a type with the System.Reflection.DefaultMemberAttribute if the type also declares an indexer.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.


Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,