vb.net 根据接口 反射调用DLL里的窗体
''' <summary>
''' 返回列表
''' </summary>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetTools() As iToolsInterface.ToolsInfo() Implements iToolsInterface.iTools.GetTools
Dim tp As Type
Dim re As New List(Of ToolsInfo)
For Each tp In Reflection.Assembly.GetExecutingAssembly.GetExportedTypes
If tp.BaseType Is GetType(Form) Then
Dim ti As New ToolsInfo
ti.Tag = Me
ti.Title = tp.Name
ti.Key = tp.FullName
ti.Img = My.Resources.ResourceManager.GetObject(tp.Name)
re.Add(ti)
End If
Next
Return re.ToArray
End Function
评论