It's easy to list all methods (functions) directly in C#, below you will find code sample. And working example you can take here.
If you are looking for static methods, you should replace BindingFlags.Instance with BindingFlags.Static
class Program
{
private int PrivateMethod() { return 0; }
protected bool ProtectedMethod() {return true; }
public void IAmFunction(object param1, Array param2) { }
static void Main(string[] args)
{
Type myType = typeof(Program);
// Get the public methods.
MethodInfo[] myMethods = myType.GetMethods(BindingFlags.Instance |
BindingFlags.DeclaredOnly|
BindingFlags.Public |
BindingFlags.NonPublic );
Console.WriteLine("i have found {0} methods of Type {1}: \n", myMethods.Length, myType.FullName);
// Display all the methods.
foreach (MethodInfo m in myMethods) {
Console.WriteLine("Name: {0}", m.Name);
Console.WriteLine("Return Type: {0}", m.ReturnType.ToString());
ParameterInfo[] parameters = m.GetParameters();
Console.WriteLine("I have {0} input parameter(s):", parameters.Length);
foreach (ParameterInfo pi in parameters) {
Console.WriteLine(" Name: {0}", pi.Name);
Console.WriteLine(" Type: {0}", pi.ParameterType.ToString());
Console.WriteLine("");
}
Console.WriteLine("------------------------------------------\n");
}
Console.WriteLine("==========================================\n");
}
}
Subscribe to:
Post Comments (Atom)
HOWTO: Repair Logitech M325 Mouse
FixIt says that you will find single screw under CE label. It isn't always true.
-
I would like to execute mysqldump using .mylogin.cnf file and --login-path option to make it more secure as it can be with plain text passwo...
-
If your worry about data left on dedicated/hosted root server and want to remove secure all files and bits, you can clean complete disk sli...
-
OUT - OF - DATE Obsolete. Please check new post ! If you have issue with Function List plugin for Notepad++ 5.1 or later, please ch...
1 comment:
thanks...
Post a Comment