public GetMethods ( ) : IKVM.Reflection.MethodInfo[] | ||
return | IKVM.Reflection.MethodInfo[] |
using System; using IKVM.Reflection; public class Program { public void Main() { Type myType = typeof(string); MethodInfo[] methods = myType.GetMethods(); foreach (MethodInfo method in methods) { Console.WriteLine(method.Name); } } }
using System; using IKVM.Reflection; public class Program { public void Main() { Type myType = typeof(Math); MethodInfo[] methods = myType.GetMethods(); foreach (MethodInfo method in methods) { if (method.Name.StartsWith("Cos")) { Console.WriteLine(method.Name); } } } }This example retrieves all the public methods of the Math type and filters them to only include methods that start with "Cos". It then prints out the names of these methods to the console. Package library: IKVM.Reflection.dll