Reflector Utilities : Reflection « Development « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Development » ReflectionScreenshots 
Reflector Utilities
   

Imports System.Windows.Forms
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Reflector
    Inherits System.Windows.Forms.Form
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.lblAssembly = New System.Windows.Forms.Label
        Me.treeTypes = New System.Windows.Forms.TreeView
        Me.cmdReflect = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'lblAssembly
        '
        Me.lblAssembly.Location = New System.Drawing.Point(109)
        Me.lblAssembly.Name = "lblAssembly"
        Me.lblAssembly.Size = New System.Drawing.Size(27212)
        Me.lblAssembly.TabIndex = 5
        '
        'treeTypes
        '
        Me.treeTypes.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom_
                    Or System.Windows.Forms.AnchorStyles.Left_
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.treeTypes.Location = New System.Drawing.Point(1029)
        Me.treeTypes.Name = "treeTypes"
        Me.treeTypes.Size = New System.Drawing.Size(362276)
        Me.treeTypes.TabIndex = 4
        '
        'cmdReflect
        '
        Me.cmdReflect.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdReflect.Location = New System.Drawing.Point(300313)
        Me.cmdReflect.Name = "cmdReflect"
        Me.cmdReflect.Size = New System.Drawing.Size(7228)
        Me.cmdReflect.TabIndex = 3
        Me.cmdReflect.Text = "Reflect"
        '
        'Reflector
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(382350)
        Me.Controls.Add(Me.lblAssembly)
        Me.Controls.Add(Me.treeTypes)
        Me.Controls.Add(Me.cmdReflect)
        Me.Font = New System.Drawing.Font("Tahoma"8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Name = "Reflector"
        Me.Text = "Reflector"
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents lblAssembly As System.Windows.Forms.Label
    Friend WithEvents treeTypes As System.Windows.Forms.TreeView
    Friend WithEvents cmdReflect As System.Windows.Forms.Button

    Private Sub cmdReflect_Click(ByVal sender As System.Object, ByVal e As System.EventArgsHandles cmdReflect.Click
        treeTypes.Nodes.Clear()

        Dim MyAssembly As System.Reflection.Assembly
        MyAssembly = System.Reflection.Assembly.GetExecutingAssembly()
        lblAssembly.Text = MyAssembly.FullName

        Dim MyTypes(), MyType As Type
        Dim MyEvents(), MyEvent As System.Reflection.EventInfo
        Dim MyMethods(), MyMethod As System.Reflection.MethodInfo
        Dim MyProperties(), MyProperty As System.Reflection.PropertyInfo

        MyTypes = MyAssembly.GetTypes()
        For Each MyType In MyTypes
            Dim nodeParent As TreeNode = treeTypes.Nodes.Add(MyType.FullName)

            Dim node As TreeNode = nodeParent.Nodes.Add("Events")
            MyEvents = MyType.GetEvents
            For Each MyEvent In MyEvents
                node.Nodes.Add(MyEvent.Name & " - event handler signature: " & _
                 MyEvent.EventHandlerType.Name)
            Next

            node = nodeParent.Nodes.Add("Methods")
            MyMethods = MyType.GetMethods()
            For Each MyMethod In MyMethods
                node.Nodes.Add(MyMethod.Name)
            Next

            node = nodeParent.Nodes.Add("Properties")
            MyProperties = MyType.GetProperties
            For Each MyProperty In MyProperties
                node.Nodes.Add(MyProperty.Name & "- data type: " & _
                MyProperty.PropertyType.ToString())
            Next
        Next

    End Sub
End Class

   
    
    
  
Related examples in the same category
1.Reflection Information for Integer ClassReflection Information for Integer Class
2.Fill Reflection Data into ListViewFill Reflection Data into ListView
3.Use Reflection to create Class instance and call methodUse Reflection to create Class instance and call method
4.Define Attributes and Use Reflection to get its valueDefine Attributes and Use Reflection to get its value
5.Get Method information and invoke Method using Reflection APIGet Method information and invoke Method using Reflection API
6.Get Method InformationGet Method Information
7.Get Class Member and Property Information from base and inherited ClassGet Class Member and Property Information from base and inherited Class
8.Reflection: display the member of Form ClassReflection: display the member of Form Class
9.The AssemblyCopyrightAttribute sets the Copyright field on the Version tab.
10.The AssemblyDescriptionAttribute sets the Comment item.
11.The AssemblyCompanyAttribute sets the Company item
12.The AssemblyProductAttribute sets the Product Name item
13.Define the assembly's only module. For a single-file assembly, the module name is the assembly name.
14.The AssemblyTitleAttribute sets the Description field on the General tab and the Version tab of the Windows file properties dialog.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.