I want to extract all the method declarations from a standard csharp .CS code file into an array, ignoring any classes. I'll be using this in validation project later which is rather complicated to explain at the moment.
So lets say our csharp code file contains the following methods:
using System.Blah;
namespace abc
{
public static class myclass
{
public void MethodA()
{
//... lines of code
}
public void MethodB()
{
//... lines of code
}
}
}
I'd like to get that into an array which can be outputted as follows
1. MethodA()
2. MethodB()
Is there code you can share or know of that would allow me to easily do this ?