Console.WriteLine(m.ToString());
}
Console.WriteLine();
}
Interesting stuff, huh? Clearly the System.Reflection namespace and System.Type class allow
you to reflect over many other aspects of a type beyond what MyTypeViewer is currently displaying.
As you would hope, you can obtain a type’s events, get the list of any generic parameters for a given
member, and glean dozens of other details.
Nevertheless, at this point you have created a (somewhat capable) object browser. The major
limitation, of course, is that you have no way to reflect beyond the current assembly (MyTypeViewer)
or the always accessible mscorlib.dll. This begs the question, “How can I build applications that
can load (and reflect over) assemblies not referenced at compile time?”
Do'stlaringiz bilan baham: |