Capturing all the function names for a class

  • Thread starter Thread starter jminiman
  • Start date Start date
J

jminiman

This might seem like an odd reques, but let's say I have a class file
that has a simple type defined, several instance functions, and several
static function. In the constructor of the class, I want to build a
string array of all the functions in the class. For the instance
functions, it looks like I can call on the MemberInfo.Name property in
Reflection...hopefully this is supported in CF.NET as it is in the
desktop framework. But what about static functions in the class file?
How can I bring those function names into my array of strongs?
 
Example:

Type t = a.GetType("System.Drawing.SystemColors");
PropertyInfo[] properties = t.GetProperties(
BindingFlags.Static | BindingFlags.DeclaredOnly |
BindingFlags.Public));
IList colors = new ArrayList();
foreach (PropertyInfo p in properties) {
object o = p.GetValue(null, null);
if (o is Color) { colors.Add(o); }
}

....
 
Back
Top