About 50 results
Open links in new tab
  1. reflection - C# Using Activator.CreateInstance - Stack Overflow

    Mar 11, 2011 · The overhead of using reflection can impede a more than 400-fold penalty: that slows down even a moderate amount of calls. The resolution is relatively easy: instead of using …

  2. How to get the list of properties of a class? - Stack Overflow

    Apr 10, 2009 · Following feedback... To get the value of static properties, pass null as the first argument to GetValue To look at non-public properties, use (for example) GetProperties(BindingFlags.Public | …

  3. java - What is reflection and why is it useful? - Stack Overflow

    Sep 1, 2008 · What is reflection, and why is it useful? I'm particularly interested in Java, but I assume the principles are the same in any language.

  4. How to dynamically create generic C# object using reflection?

    Oct 3, 2015 · I want to dynamically create TaskA or TaskB using C# reflection (Activator.CreateInstance). However I wouldn't know the type before hand, so I need to dynamically …

  5. c# - Set object property using reflection - Stack Overflow

    Is there a way in C# where I can use reflection to set an object property? Ex: MyObject obj = new MyObject(); obj.Name = "Value"; I want to set obj.Name with reflection. Something like: Reflection.

  6. Reflection support in C - Stack Overflow

    Aug 30, 2009 · Reflection as analysis is generally very weak; usually it can only provide access to function and field names. This weakness comes from the language implementers essentially not …

  7. Comparing Object properties using reflection - Stack Overflow

    The main value of reflection would be to write a general purpose object comparer that could take two instances of any kind of object and compare their public fields and properties. This helps avoid …

  8. reflection - C# getting its own class name - Stack Overflow

    Jan 21, 2010 · If I have a class called MyProgram, is there a way of retrieving "MyProgram" as a string?

  9. java - How do I test a class that has private methods, fields or inner ...

    Aug 29, 2008 · How do I use JUnit to test a class that has internal private methods, fields or nested classes? It seems bad to change the access modifier for a method just to be able to run a test.

  10. what is reflection in C#, what are the benefit. How to use it to get ...

    Jun 23, 2010 · Reflection is the ability of types to provide information about themselves. For example, an assembly can tell you what it contains, a type can tell you its methods, properties and so on.