Skip to main content

Posts

Showing posts from April, 2014

Reflection in Dot Net (.Net)

According to msdn , putting all the definition at one place:- Reflection provides objects (of type Type) that encapsulate assemblies, modules and types. A type represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.  You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. If you are using attributes in your code, Reflection enables you to access them. Below is the code example for it. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace reflection {   class Program    {      static void Main( string [] args)        {        ...