SlideShare a Scribd company logo
Interactive Session on Reflection
In C Sharp
                                    Classification: Restricted   2012-04-19
Reflection


•Reflection is the Feature that enables you to obtain the information about a type.
•All .NET assemblies have metadata information stored about the types defined in
modules. This metadata information can be accessed by mechanism called as
“Reflection”.
•Reflection is the ability of a managed code to read its own metadata for the purpose of
finding assemblies, modules and type information at runtime. In other words, reflection
provides objects that encapsulate assemblies, modules and types. A program reflects
on itself by extracting metadata from its assembly and using that metadata either to
inform the user or to modify its own behavior. Reflection is similar to C++ RTTI (Runtime
Type Information), but much broader in scope and capability




2   Classification: Restricted   2012-04-19
Reflection
Name Space to be used System.reflection

• When writing a C# code that uses reflection, the coder can use the type of operator
  to get the object's type or use the GetType() method to get the type of the current
  instance.
• Using reflection services, we are able to programmatically obtain the same
  metadata information displayed by ildasm.exe.




3   Classification: Restricted   2012-04-19
Example of Reflection

• Using GetType to obtain type information:
C# Code :-


• int i = 42;
System.Type type = i.GetType();
System.Console.WriteLine(type);


• Output of this Code will be
System.Int32




4   Classification: Restricted   2012-04-19
When use Reflection



• If we want to know assembly information at run time ,then we use reflection.
  Reflection are used for data binding in .NET Framework. It is also used for testing in
  .NET Framework.




5   Classification: Restricted   2012-04-19
Example

• In the below example reflection is used to obtain the full name of a loaded
  assembly:
CODE
System.Reflection.Assembly o = System.Reflection.Assembly.Load("mscorlib.dll");
System.Console.WriteLine(o.GetName());


Output of the above code
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089




6   Classification: Restricted   2012-04-19
So Reflection allows you to

• Enumerate the members of a type
• Instantiate a new object
• Execute the members of an object
• Find out information about a type
• Find out information about an assembly
• Inspect the custom attributes applied to a type
• Create and compile a new assembly




7   Classification: Restricted   2012-04-19
System.Reflection Namespace




8   Classification: Restricted   2012-04-19
The System.Type Class

• The System.Type class defines a number of members that can be used to examine
  a type’s metadata, a great number of which return types from the System.Reflection
  namespace.
• Eg: Type.GetMethods() returns an array of MethodInfo types, Type.GetFields()
  returns an array of FieldInfo types.




9   Classification: Restricted   2012-04-19
Members of System.Type
• IsAbstract
• IsArray
• IsClass
• IsCOMObject
• IsEnum
• IsInterface
• IsPrimitive
• IsNestedPrivate
• IsNestedPublic
• IsSealed
• IsValueType


• These properties allow you to discover a number of basic traits about the Type you are referring to
  (e.g., if it is an abstract method, an array, a nested class, and so forth).




10   Classification: Restricted   2012-04-19
Methods
• GetConstructors()
• GetEvents()
• GetFields()
• GetInterfaces()
• GetMembers()
• GetMethods().
• GetNestedTypes()
• GetProperties()
• These methods allow you to obtain an array representing the items (interface, method,
  property, etc.) you are interested in. Each method returns a related array (e.g.,
  GetFields() returns a FieldInfo array, GetMethods() returns a MethodInfo array, etc.).
  Each of these methods has a singular form (e.g., GetMethod(), GetProperty(), etc.) that
  allows you to retrieve a specific item by name, rather than an array of all related items.



11   Classification: Restricted   2012-04-19
Methods

• GetType()
        To obtain type information, you may call the static GetType() member of the
        System.Type class and specify the fully qualified string name of the type to
        examine.
        Compile-time knowledge of the type to be extracted from metadata is not
        required.




12   Classification: Restricted   2012-04-19
GET TYPE METHOD

• The Type.GetType() method has overloads to allow you to specify two Boolean
  parameters, one of which controls whether an exception should be thrown if the
  type cannot be found, and the other of which establishes the case sensitivity of the
  string.
• Obtaining type information using the static Type.GetType() method:
•                  Type t = Type.GetType("CarLibrary.SportsCar", false, true);




13   Classification: Restricted   2012-04-19
Reflecting on Methods
• Type.GetMethods() returns an array of System.Reflection.MethodInfo types.


// Display method names of type.
public static void ListMethods(Type t)
{
     Console.WriteLine("Methods");
     MethodInfo[] mi = t.GetMethods();
     foreach(MethodInfo m in mi)
                    Console.WriteLine("->{0}", m.Name);
     Console.WriteLine("");
}



14    Classification: Restricted   2012-04-19
Reflecting on Fields

• Type.GetFields() returns an array of System.Reflection.FieldInfo types.


// Display field names of type
public static void ListFields(Type t)
{
     Console.WriteLine("Fields");
     FieldInfo[] fi = t.GetFields();
     foreach(FieldInfo field in fi)
                    Console.WriteLine("->{0}", field.Name);
     Console.WriteLine("");
}



15    Classification: Restricted   2012-04-19
Reflecting on Properties
• Type. GetProperties() returns an array of System.Reflection. PropertyInfo types.


// Display property names of type.
public static void ListProps(Type t)
{
     Console.WriteLine("***** Properties *****");
     PropertyInfo[] pi = t.GetProperties();
     foreach(PropertyInfo prop in pi)
                    Console.WriteLine("->{0}", prop.Name);
     Console.WriteLine("");
}



16    Classification: Restricted   2012-04-19
Dynamically Loading Assemblies

• The act of loading external assemblies on demand is known as a dynamic load.
• System.Reflection defines a class Assembly. Which enables to dynamically load an
  assembly and discover properties about the assembly.
• Assembly type enables to dynamically load private or shared assemblies, as well as
  load an assembly located at an arbitrary location.




17   Classification: Restricted   2012-04-19
Late Binding

• Late binding is a technique in which you are able to create an instance of a given
  type and invoke its members at runtime without having compile-time knowledge of
  its existence.
• It increases applications Extensibility.




18   Classification: Restricted   2012-04-19
Reflection in C #

Harman
Aplication Developer




19   Classification: Restricted   2012-04-19
Ad

Recommended

Java Collections Framework
Java Collections Framework
Sony India Software Center
 
Java collections concept
Java collections concept
kumar gaurav
 
Reflection in C#
Reflection in C#
Rohit Vipin Mathews
 
Collections in Java Notes
Collections in Java Notes
Shalabh Chaudhary
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)
BOSS Webtech
 
Java constructors
Java constructors
QUONTRASOLUTIONS
 
ADO.NET
ADO.NET
Farzad Wadia
 
Collection Framework in java
Collection Framework in java
CPD INDIA
 
Xml serialization
Xml serialization
Raghu nath
 
javascript objects
javascript objects
Vijay Kalyan
 
Collections In Java
Collections In Java
Binoj T E
 
Simple object access protocol(soap )
Simple object access protocol(soap )
balamurugan.k Kalibalamurugan
 
Spring ppt
Spring ppt
Mumbai Academisc
 
Method Overloading in Java
Method Overloading in Java
Sonya Akter Rupa
 
Java Thread Synchronization
Java Thread Synchronization
Benj Del Mundo
 
jQuery PPT
jQuery PPT
Dominic Arrojado
 
Oops concept on c#
Oops concept on c#
baabtra.com - No. 1 supplier of quality freshers
 
Java interfaces
Java interfaces
Raja Sekhar
 
C# Delegates
C# Delegates
Raghuveer Guthikonda
 
android sqlite
android sqlite
Deepa Rani
 
Wrapper classes
Wrapper classes
Kongu Engineering College, Perundurai, Erode
 
ReactJS presentation.pptx
ReactJS presentation.pptx
DivyanshGupta922023
 
Typescript ppt
Typescript ppt
akhilsreyas
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
Bootstrap ppt
Bootstrap ppt
Nidhi mishra
 
Oop concepts in python
Oop concepts in python
baabtra.com - No. 1 supplier of quality freshers
 
Serialization/deserialization
Serialization/deserialization
Young Alista
 
Constructor in java
Constructor in java
Pavith Gunasekara
 
Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Rohit Vipin Mathews
 
Reflection Slides by Zubair Dar
Reflection Slides by Zubair Dar
zubairdar6
 

More Related Content

What's hot (20)

Xml serialization
Xml serialization
Raghu nath
 
javascript objects
javascript objects
Vijay Kalyan
 
Collections In Java
Collections In Java
Binoj T E
 
Simple object access protocol(soap )
Simple object access protocol(soap )
balamurugan.k Kalibalamurugan
 
Spring ppt
Spring ppt
Mumbai Academisc
 
Method Overloading in Java
Method Overloading in Java
Sonya Akter Rupa
 
Java Thread Synchronization
Java Thread Synchronization
Benj Del Mundo
 
jQuery PPT
jQuery PPT
Dominic Arrojado
 
Oops concept on c#
Oops concept on c#
baabtra.com - No. 1 supplier of quality freshers
 
Java interfaces
Java interfaces
Raja Sekhar
 
C# Delegates
C# Delegates
Raghuveer Guthikonda
 
android sqlite
android sqlite
Deepa Rani
 
Wrapper classes
Wrapper classes
Kongu Engineering College, Perundurai, Erode
 
ReactJS presentation.pptx
ReactJS presentation.pptx
DivyanshGupta922023
 
Typescript ppt
Typescript ppt
akhilsreyas
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
Bootstrap ppt
Bootstrap ppt
Nidhi mishra
 
Oop concepts in python
Oop concepts in python
baabtra.com - No. 1 supplier of quality freshers
 
Serialization/deserialization
Serialization/deserialization
Young Alista
 
Constructor in java
Constructor in java
Pavith Gunasekara
 

Similar to Reflection in C Sharp (20)

Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Rohit Vipin Mathews
 
Reflection Slides by Zubair Dar
Reflection Slides by Zubair Dar
zubairdar6
 
Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#
Wekoslav Stefanovski
 
Reflection
Reflection
Yaswanth Babu Gummadivelli
 
Reflecting On The Code Dom
Reflecting On The Code Dom
Nick Harrison
 
15reflection in c#
15reflection in c#
Sireesh K
 
Reflection
Reflection
Chester Hartin
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
Dan Douglas
 
Java Reflection Concept and Working
Java Reflection Concept and Working
Software Productivity Strategists, Inc
 
.NET Reflection
.NET Reflection
Robert MacLean
 
Reflection Mcq's by Zubair Dar
Reflection Mcq's by Zubair Dar
zubairdar6
 
Understanding Reflection
Understanding Reflection
Tamir Khason
 
Reflection in java
Reflection in java
upen.rockin
 
Reflection in Java
Reflection in Java
Nikhil Bhardwaj
 
Review of c_sharp2_features_part_i
Review of c_sharp2_features_part_i
Nico Ludwig
 
Understanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
 
Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
Buu Nguyen
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
Mohammad Shaker
 
Net framework session01
Net framework session01
Vivek Singh Chandel
 
Framework Project Portfolio
Framework Project Portfolio
Domingos Salvador
 
Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Rohit Vipin Mathews
 
Reflection Slides by Zubair Dar
Reflection Slides by Zubair Dar
zubairdar6
 
Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#
Wekoslav Stefanovski
 
Reflecting On The Code Dom
Reflecting On The Code Dom
Nick Harrison
 
15reflection in c#
15reflection in c#
Sireesh K
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
Dan Douglas
 
Reflection Mcq's by Zubair Dar
Reflection Mcq's by Zubair Dar
zubairdar6
 
Understanding Reflection
Understanding Reflection
Tamir Khason
 
Reflection in java
Reflection in java
upen.rockin
 
Review of c_sharp2_features_part_i
Review of c_sharp2_features_part_i
Nico Ludwig
 
Understanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
 
Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
Buu Nguyen
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
Mohammad Shaker
 
Ad

Recently uploaded (20)

Paper 107 | From Watchdog to Lapdog: Ishiguro’s Fiction and the Rise of “Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguro’s Fiction and the Rise of “Godi...
Rajdeep Bavaliya
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
June 2025 Progress Update With Board Call_In process.pptx
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
jutaydeonne
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
jutaydeonne
 
Pests of Maize: An comprehensive overview.pptx
Pests of Maize: An comprehensive overview.pptx
Arshad Shaikh
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
Paper 107 | From Watchdog to Lapdog: Ishiguro’s Fiction and the Rise of “Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguro’s Fiction and the Rise of “Godi...
Rajdeep Bavaliya
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
jutaydeonne
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
jutaydeonne
 
Pests of Maize: An comprehensive overview.pptx
Pests of Maize: An comprehensive overview.pptx
Arshad Shaikh
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
Ad

Reflection in C Sharp

  • 1. Interactive Session on Reflection In C Sharp Classification: Restricted 2012-04-19
  • 2. Reflection •Reflection is the Feature that enables you to obtain the information about a type. •All .NET assemblies have metadata information stored about the types defined in modules. This metadata information can be accessed by mechanism called as “Reflection”. •Reflection is the ability of a managed code to read its own metadata for the purpose of finding assemblies, modules and type information at runtime. In other words, reflection provides objects that encapsulate assemblies, modules and types. A program reflects on itself by extracting metadata from its assembly and using that metadata either to inform the user or to modify its own behavior. Reflection is similar to C++ RTTI (Runtime Type Information), but much broader in scope and capability 2 Classification: Restricted 2012-04-19
  • 3. Reflection Name Space to be used System.reflection • When writing a C# code that uses reflection, the coder can use the type of operator to get the object's type or use the GetType() method to get the type of the current instance. • Using reflection services, we are able to programmatically obtain the same metadata information displayed by ildasm.exe. 3 Classification: Restricted 2012-04-19
  • 4. Example of Reflection • Using GetType to obtain type information: C# Code :- • int i = 42; System.Type type = i.GetType(); System.Console.WriteLine(type); • Output of this Code will be System.Int32 4 Classification: Restricted 2012-04-19
  • 5. When use Reflection • If we want to know assembly information at run time ,then we use reflection. Reflection are used for data binding in .NET Framework. It is also used for testing in .NET Framework. 5 Classification: Restricted 2012-04-19
  • 6. Example • In the below example reflection is used to obtain the full name of a loaded assembly: CODE System.Reflection.Assembly o = System.Reflection.Assembly.Load("mscorlib.dll"); System.Console.WriteLine(o.GetName()); Output of the above code mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 6 Classification: Restricted 2012-04-19
  • 7. So Reflection allows you to • Enumerate the members of a type • Instantiate a new object • Execute the members of an object • Find out information about a type • Find out information about an assembly • Inspect the custom attributes applied to a type • Create and compile a new assembly 7 Classification: Restricted 2012-04-19
  • 8. System.Reflection Namespace 8 Classification: Restricted 2012-04-19
  • 9. The System.Type Class • The System.Type class defines a number of members that can be used to examine a type’s metadata, a great number of which return types from the System.Reflection namespace. • Eg: Type.GetMethods() returns an array of MethodInfo types, Type.GetFields() returns an array of FieldInfo types. 9 Classification: Restricted 2012-04-19
  • 10. Members of System.Type • IsAbstract • IsArray • IsClass • IsCOMObject • IsEnum • IsInterface • IsPrimitive • IsNestedPrivate • IsNestedPublic • IsSealed • IsValueType • These properties allow you to discover a number of basic traits about the Type you are referring to (e.g., if it is an abstract method, an array, a nested class, and so forth). 10 Classification: Restricted 2012-04-19
  • 11. Methods • GetConstructors() • GetEvents() • GetFields() • GetInterfaces() • GetMembers() • GetMethods(). • GetNestedTypes() • GetProperties() • These methods allow you to obtain an array representing the items (interface, method, property, etc.) you are interested in. Each method returns a related array (e.g., GetFields() returns a FieldInfo array, GetMethods() returns a MethodInfo array, etc.). Each of these methods has a singular form (e.g., GetMethod(), GetProperty(), etc.) that allows you to retrieve a specific item by name, rather than an array of all related items. 11 Classification: Restricted 2012-04-19
  • 12. Methods • GetType() To obtain type information, you may call the static GetType() member of the System.Type class and specify the fully qualified string name of the type to examine. Compile-time knowledge of the type to be extracted from metadata is not required. 12 Classification: Restricted 2012-04-19
  • 13. GET TYPE METHOD • The Type.GetType() method has overloads to allow you to specify two Boolean parameters, one of which controls whether an exception should be thrown if the type cannot be found, and the other of which establishes the case sensitivity of the string. • Obtaining type information using the static Type.GetType() method: • Type t = Type.GetType("CarLibrary.SportsCar", false, true); 13 Classification: Restricted 2012-04-19
  • 14. Reflecting on Methods • Type.GetMethods() returns an array of System.Reflection.MethodInfo types. // Display method names of type. public static void ListMethods(Type t) { Console.WriteLine("Methods"); MethodInfo[] mi = t.GetMethods(); foreach(MethodInfo m in mi) Console.WriteLine("->{0}", m.Name); Console.WriteLine(""); } 14 Classification: Restricted 2012-04-19
  • 15. Reflecting on Fields • Type.GetFields() returns an array of System.Reflection.FieldInfo types. // Display field names of type public static void ListFields(Type t) { Console.WriteLine("Fields"); FieldInfo[] fi = t.GetFields(); foreach(FieldInfo field in fi) Console.WriteLine("->{0}", field.Name); Console.WriteLine(""); } 15 Classification: Restricted 2012-04-19
  • 16. Reflecting on Properties • Type. GetProperties() returns an array of System.Reflection. PropertyInfo types. // Display property names of type. public static void ListProps(Type t) { Console.WriteLine("***** Properties *****"); PropertyInfo[] pi = t.GetProperties(); foreach(PropertyInfo prop in pi) Console.WriteLine("->{0}", prop.Name); Console.WriteLine(""); } 16 Classification: Restricted 2012-04-19
  • 17. Dynamically Loading Assemblies • The act of loading external assemblies on demand is known as a dynamic load. • System.Reflection defines a class Assembly. Which enables to dynamically load an assembly and discover properties about the assembly. • Assembly type enables to dynamically load private or shared assemblies, as well as load an assembly located at an arbitrary location. 17 Classification: Restricted 2012-04-19
  • 18. Late Binding • Late binding is a technique in which you are able to create an instance of a given type and invoke its members at runtime without having compile-time knowledge of its existence. • It increases applications Extensibility. 18 Classification: Restricted 2012-04-19
  • 19. Reflection in C # Harman Aplication Developer 19 Classification: Restricted 2012-04-19