What is reflection, DOT NET Programming

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

 

Posted Date: 9/18/2012 7:33:38 AM | Location : United States







Related Discussions:- What is reflection, Assignment Help, Ask Question on What is reflection, Get Answer, Expert's Help, What is reflection Discussions

Write discussion on What is reflection
Your posts are moderated
Related Questions
I need Complete ERP Solution of Jeweler Manufacturing Project Description: MY Project Have Complete ERP Solution of jewellary manufacturing Process. By Using of my software y

31: Need to develop Doctor Appointments application in .NET Project Description: I am seeking a .NET Web application which can do the subsequent: 1. Taking doctors and

Among the items that are related to the implementation of an application for automation of processes, are shown as follows: a) The online patient registry through which patients

Name the control that exposes the LINQ features to Web developers through the ASP.NET data-source control architecture. The LinqDataSource control exposes the LINQ features to

Program of Reversing Array - C# Program Please provide me assignment help regarding my problem.

How can you implement a condition in a workflow? You can implement a condition by using either of the following ways: By creating a rule condition - Specifies that you can e

What is cloud computing? The cloud computing is the computing which is completely based on the Internet. It can also be explained as the next stage in the evolution of the Inte

What are Windows services? Windows services, previously called as NT services, are applications that are installed on the system as system services. In other words, Windows ser

I want to develop a Windows 8.1 Application Project Description: Media Player App Development for Windows 8.1 platform with brilliant UI, flexible controls and easy to use.

What is difference between SITP and UTP in testing? The Unit Test Plan (UTP) are completed at smallest unit level or stand alone mode. For example you have Customer and invoici