Type.GetMethods Method ()
Returns all the public methods of the current Type.
[Visual Basic] Overloads Public Function GetMethods() As MethodInfo() [C#] public MethodInfo GetMethods(); [C++] public: MethodInfo* GetMethods() ; [JScript] public function GetMethods() : MethodInfo;
An empty array of type MethodInfo, if no public methods are defined for the current Type.
Constructors are not included in the array of methods returned by this call. Make a separate call to GetConstructors() to get the constructor methods.
The following table shows what members of a base class are returned by the Get methods when reflecting on a type.
|Field||No||Yes. A field is always hide-by-name-and-signature.|
|Event||Not applicable||The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.|
|Method||No||Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature.|
|Property||Not applicable||The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.|
- Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison.
- For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class.
- Custom attributes are not part of the common type system.
Note You cannot omit parameters when looking up constructors and methods. You can only omit parameters when invoking.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard