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.
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)
{
var
type = typeof(Program);
var
members = type.GetMembers(BindingFlags.Static
| BindingFlags.Public
| BindingFlags.NonPublic
| BindingFlags.Instance);
foreach
(var
MemberInfo in
members)
{
Console.WriteLine(MemberInfo.Name);
}
Console.Read();
}
}
}
You can see while debugging its a reflection and by using Name space using System.Reflection we are using the reflection properties.
Thanks for your great and helpful presentation I like your good service. I always appreciate your post. That is very interesting I love reading and I am always searching for informative information like this. Well written article Thank You for Sharing with Us
ReplyDeleteDot Net Training Center in Chennai | Dot Net Training Institute in Chennai
Selenium Training Institute in Chennai | Selenium Testing Training in Chennai
Testing Courses in Chennai | Software Testing Training in Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Course and Certification
PHP Course in Chennai