reflection
What's the proper way to use reflection to instantiate objects of unknown classes at runtime?
I am working on a Configuration Loader cl开发者_运维百科ass so that I can change the parameters of my program via an external text file (config.txt) rather than having to recompile my code with every[详细]
2023-04-11 11:39 分类:问答Setting static events to null using reflection
I have the following problem: I got a class with ~100 static events and i want to set all those events to null (removing all delegates) when Disposing.[详细]
2023-04-11 10:23 分类:问答Get list of C structure members
Is it possible to get the list of members of a structure as a char ** ? For example, something like this:[详细]
2023-04-11 08:49 分类:问答Why does Tomcat use reflection for Catalina instancilization
Reading the Tomcat 7 source code, I just wonder why Tomcat instance Catalina and invokes the related methods by using reflection instead of simply using new to create the object and calling the method[详细]
2023-04-11 07:39 分类:问答Dynamically load class for rules engine
I have a XML file that defines a lot of rules. I load the XML file into my rules engine. Depending on what XML file I load i need to pick which namespace I will find the classes I need. Then on each[详细]
2023-04-11 07:03 分类:问答Calling a method when the method name is contained in a string
Let\'s say I have a page Test.aspx along with test.aspx.vb. Test.aspx.vb contains a class name \"TestClass\". In that class I have method1(), method2() and method3()[详细]
2023-04-11 05:42 分类:问答How can I create an instance when I only have the name of the class?
I\'m looking for a solution to create singleton instances of classes, when only the names of the class will be available.[详细]
2023-04-11 05:16 分类:问答Type from Scala reflection
Suppose that I have: trait A class B extends A compiled into class files. Later I load those using reflection:[详细]
2023-04-11 04:29 分类:问答Using Java reflection vs checking Build.VERSION.SDK_INT
Why should I bother using reflection as discussed here, if I can simply test Android version from Build.VERSION.SDK_INT and conditionally run functions not available on lower API versions?[详细]
2023-04-11 03:37 分类:问答Is there a way to “reflect” ILGenerator.Emit commands from IL code?
I am trying to dynamically emit some generic method that I’ve prototyped in C#. Based on IL code presented in ILDASM, is there a way to generate adequate sequence of ILGenerator.Emit() commands that[详细]
2023-04-11 00:20 分类:问答