What is reflection, DOT NET Programming

Assignment Help:

Reflection

All .NET assemblies have metadata information stored  the types defined in the modules. And This metadata information can be accessed by mechanism called as "Reflection". The System.Reflection is used to browse through the metadata information.

By Using the reflection we can also dynamically invoke methods using the System.The Type.InvokeMember. Below is the sample source code if needed we can also get this code from the CD provided, go to the  "Source code" folder in the "Reflection Sample" folder.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Pobjtype As Type
    Dim PobjObject As Object
    Dim PobjButtons As New Windows.Forms.Button()
    Pobjtype = PobjButtons.GetType()
For Each PobjObject In Pobjtype.GetMembers
LstDisplay.Items.Add(PobjObject.ToString())
Next
End Sub
End Class

1506_reflection display.jpg


Sample source code uses reflection to browse through "Button" class of "Windows.Forms". If we compile & run the program following is the output as shown in "Sample Reflection Display". By Using the reflection we can also dynamically invoke a method using "System.Type.Invoke Member".

 


Related Discussions:- What is reflection

What is the role of the jit compiler in .net framework, What is the role of...

What is the role of the JIT compiler in .NET Framework? The JIT compiler is an significant element of CLR, which loads MSIL on target machines for execution. The MSIL is stored

Car (causal analysis and resolution), What is CAR (Causal Analysis and Reso...

What is CAR (Causal Analysis and Resolution)? The basic purpose of the CAR is to analyze all the problems, defects, and good practices/positive triggers in projects, perform a

Explain manifest, What is Manifest? Assembly metadata is keeps in Manif...

What is Manifest? Assembly metadata is keeps in Manifest. Manifest contains all the metadata required to do the following things     Version of assembly.     Security ide

I require to syn my microsoft exchange calendar, Google Calendar Project...

Google Calendar Project Description: I require to syn my Microsoft exchange calendar with the Google calendar so i will view the all the changes that happen in Microsoft exch

Develop one web based application, Project Description: Specifically i n...

Project Description: Specifically i need develop one web based application which have student registration and according to semester and each time it will change as per semester

Reversing the numbers - c# program, Reversing the Numbers - C# Program ...

Reversing the Numbers - C# Program Hello guys i need your advice. How can i reverse the integer number in c# project? Please recommend some examples.

Develop a iphone and android mobile game, Develop a iPhone and Android mobi...

Develop a iPhone and Android mobile game Project Description: I am seeking a developer to create a mobile game for me. I need an endless runner game with simple controls. The

Media player app development for windows, Media Player App Development for ...

Media Player App Development for Windows 8.1 platform with outstanding UI, flexible controls and simple to use. The app should be consist of 1. Normal player controls 2. s

Prepare a script to automate the software muvee reveal, Prepare a script to...

Prepare a script to automate the software "muvee Reveal" Project Description: My name is Mark, I run a company engaged in E-Learning products. We looked for a long time fo

Djvu view and setup- sourcecode with nice ui, Djvu view and setup,  sourcec...

Djvu view and setup,  sourcecode with nice UI Project Description: i want an application build for viewing djvu files -must include setup -must include source code -

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd