About 2,060,000 results
Open links in new tab
  1. 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 …

  2. 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.

  3. Change private static final field using Java reflection

    Jul 21, 2010 · I have a class with a private static final field that, unfortunately, I need to change it at run-time. Using reflection I get this error: java.lang.IllegalAccessException: Can not set …

  4. c# - Getting Enum value via reflection - Stack Overflow

    Nov 27, 2012 · I have a simple Enum public enum TestEnum { TestOne = 3, TestTwo = 4 } var testing = TestEnum.TestOne; And I want to retrieve its value (3) via reflection. Any ideas on …

  5. Reflection - get attribute name and value on property

    Jul 9, 2011 · In my main method, I'm using reflection and wish to get key value pair of each attribute for each property. So in this example, I'd expect to see "Author" for attribute name …

  6. reflection - Cast to a reflected Type in C# - Stack Overflow

    Foo result = (Foo)objFoo; There's no real point in casting an object to a type that's unknown at compile time - you won't be able to use it: object objFoo = MakeFoo(); UnkownType result = …

  7. c# - Using reflection to get values from properties from a list of a ...

    May 23, 2012 · Using reflection to get values from properties from a list of a class Asked 13 years, 1 month ago Modified 12 years, 8 months ago Viewed 69k times

  8. Reflection class to get all properties of any object

    Oct 26, 2010 · Reflection class to get all properties of any object Asked 14 years, 8 months ago Modified 12 years, 11 months ago Viewed 23k times

  9. Reflection: How to Invoke Method with parameters - Stack Overflow

    I am trying to invoke a method via reflection with parameters and I get: object does not match target type If I invoke a method without parameters, it works fine. Based on the following code …

  10. Using reflection in C# to get properties of a nested object

    Using reflection in C# to get properties of a nested object Asked 15 years, 6 months ago Modified 2 years, 11 months ago Viewed 126k times