J
jibesh.vp
Hi all,
I have a doubt in using C# Reflection mechanism .
What i need is to get method info alone from a class type.
Following code gets all the Properties inside the class too and there is no
way to
differentiate a method from property.
MemberType propertie of the MethodInfo class always have the value " Method
" for all the methods and properites
Any Help
sample:
public class MyTypeClass
{
public void MyMethods() { }
private int data;
public int Data
{
get{ return this.data; }
set { this.data = value; }
}
}
public class TypeMain
{
public static void Main()
{
Type myType =(typeof(MyTypeClass));
MethodInfo[] myArrayMethodInfo =
myType.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly);
- Jibesh.V.P
I have a doubt in using C# Reflection mechanism .
What i need is to get method info alone from a class type.
Following code gets all the Properties inside the class too and there is no
way to
differentiate a method from property.
MemberType propertie of the MethodInfo class always have the value " Method
" for all the methods and properites
Any Help
sample:
public class MyTypeClass
{
public void MyMethods() { }
private int data;
public int Data
{
get{ return this.data; }
set { this.data = value; }
}
}
public class TypeMain
{
public static void Main()
{
Type myType =(typeof(MyTypeClass));
MethodInfo[] myArrayMethodInfo =
myType.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly);
- Jibesh.V.P