R
Ron
I am building a utility that needs to extract all Windows forms control
names from a compiled assembly for documentation purposes.
I am currently using reflection, but not all of the controls are coming
back. What should I be doing differently?
Thanks,
Ron
private void Reflect(string AssemblyPath)
{
Assembly assem = Assembly.LoadFrom(AssemblyPath);
Type[] types = assem.GetTypes();
foreach (Type t in types)
{
try
{
richTextBox1.Text += ("\r\n" + t.FullName + "\r\n");
MemberInfo[] mbrInfoArray = t.GetMembers();
foreach (MemberInfo mbrInfo in mbrInfoArray)
{
richTextBox1.Text += string.Format("{0} is a
{1}\r\n", mbrInfo, mbrInfo.MemberType);
Application.DoEvents();
}
}
}
catch (System.NullReferenceException)
{
Console.WriteLine("Error msg");
}
}
}
}
names from a compiled assembly for documentation purposes.
I am currently using reflection, but not all of the controls are coming
back. What should I be doing differently?
Thanks,
Ron
private void Reflect(string AssemblyPath)
{
Assembly assem = Assembly.LoadFrom(AssemblyPath);
Type[] types = assem.GetTypes();
foreach (Type t in types)
{
try
{
richTextBox1.Text += ("\r\n" + t.FullName + "\r\n");
MemberInfo[] mbrInfoArray = t.GetMembers();
foreach (MemberInfo mbrInfo in mbrInfoArray)
{
richTextBox1.Text += string.Format("{0} is a
{1}\r\n", mbrInfo, mbrInfo.MemberType);
Application.DoEvents();
}
}
}
catch (System.NullReferenceException)
{
Console.WriteLine("Error msg");
}
}
}
}