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 difference between vb.net and c#?, Difference between VB.NET an...

Difference between VB.NET and C# This is the main debatable issue in .NET community and everyone treat their languages like religion. It is a very important matter which lan

I need very easy project in metatrader, I need very easy project in metatra...

I need very easy project in metatrader Project Description: I have 3 indicators.... ADX, emas crossover and macd crossover! They are all signals, arrows! But i would like to

Wfp and windows hook drivers expert required, WFP and windows hook drivers ...

WFP and windows hook drivers expert required Project Description: I want a class which will have a function to block a particular url. I want this to be done using Windows

What is asp.net authentication providers and iis security, What is ASP.NET ...

What is ASP.NET Authentication Providers and IIS Security? ASP.NET executes authentication using authentication providers, which are code modules that determine credentials and

Very very boards, Very, Very Boards does a big business in shirts, especial...

Very, Very Boards does a big business in shirts, especially for groups and teams. They need a project that will calculate the price for individual orders, as well as a summary for

What is an identifier, What is an identifier? Identifiers are northing ...

What is an identifier? Identifiers are northing but names given to various entities uniquely identified in a program. The name of identifiers must vary in spelling or casing. F

Crystal Report base output, Hello, I want to develop one crystal report. I ...

Hello, I want to develop one crystal report. I have one database which has 5 field.One is string and others are Boolean. String field name is State and Four remaining fields are Th

Basic methods of data adapter, What are basic methods of Data adapter? ...

What are basic methods of Data adapter? The three most commonly used methods of Dataadapter are as follows:- 1)Fill :- It Executes the SelectCommand to fill the DataSet ob

State the advantages of xml schemas over dtd, State the advantages of XML s...

State the advantages of XML schemas over DTD. Microsoft developed a language called as the XML Schema Definition (XSD) to explain the schema to an XML document. The following a

Windowsapplications., what is the code for calculator in windowsapplication...

what is the code for calculator in windowsapplication

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