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(10, 9)
Me.lblAssembly.Name = "lblAssembly"
Me.lblAssembly.Size = New System.Drawing.Size(272, 12)
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(10, 29)
Me.treeTypes.Name = "treeTypes"
Me.treeTypes.Size = New System.Drawing.Size(362, 276)
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(300, 313)
Me.cmdReflect.Name = "cmdReflect"
Me.cmdReflect.Size = New System.Drawing.Size(72, 28)
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(382, 350)
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.EventArgs) Handles 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
|