System.Reflection.MethodBase.IsHideBySig Property

Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class.

Syntax

public bool IsHideBySig { get; }

Value

Documentation for this section has not yet been entered.

Remarks

When a member in a derived class is declared with the C# new modifier or the Visual Basic Shadows modifier, it can hide a member of the same name in the base class. C# hides base class members by signature. That is, if the base class member has multiple overloads, the only one that is hidden is the one that has the identical signature. By contrast, Visual Basic hides all the base class overloads. Thus, MethodBase.IsHideBySig returns false on a member declared with the Visual Basic Shadows modifier, and true on a member declared with the C# new modifier.

Note:

This property does not determine whether a method has the MethodAttributes.NewSlot attribute. A method that is declared with either the new or the Shadows modifier will have the MethodAttributes.NewSlot attribute, but only methods declared with new (that is, only C# methods) will have the MethodBase.IsHideBySig property set to true. To determine whether a method has the MethodAttributes.NewSlot attribute, use code similar to the following: if ((myMethodInfo.Attributes & MethodAttributes.VtableLayoutMask) == MethodAttributes.NewSlot) in C# or If (myMethodInfo.Attributes And MethodAttributes.VtableLayoutMask) = MethodAttributes.NewSlot in Visual Basic. Note, however, that although all methods declared with new or Shadows have the MethodAttributes.NewSlot attribute, not all methods that have the MethodAttributes.NewSlot attribute are declared with new or Shadows.

Requirements

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