Files
ayanova7/API/plugins/VBSamplePlugin/VBSamplePlugin/AboutBox1.vb
2018-06-29 19:47:36 +00:00

80 lines
3.2 KiB
VB.net

Imports System.Reflection
Public NotInheritable Class AboutBox1
Private Sub AboutBox1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = [String].Format("About {0} {0}", AssemblyTitle)
Me.LabelProductName.Text = AssemblyProduct
Me.LabelVersion.Text = [String].Format("Version {0} {0}", AssemblyVersion)
Me.LabelCopyright.Text = AssemblyCopyright
Me.LabelCompanyName.Text = AssemblyCompany
Me.TextBoxDescription.Text = AssemblyDescription
End Sub
Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
Me.Close()
End Sub
#Region "Assembly Attribute Accessors"
Public ReadOnly Property AssemblyTitle() As String
Get
Dim attributes As Object() = Assembly.GetExecutingAssembly().GetCustomAttributes(GetType(AssemblyTitleAttribute), False)
If attributes.Length > 0 Then
Dim titleAttribute As AssemblyTitleAttribute = DirectCast(attributes(0), AssemblyTitleAttribute)
If titleAttribute.Title <> "" Then
Return titleAttribute.Title
End If
End If
Return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase)
End Get
End Property
Public ReadOnly Property AssemblyVersion() As String
Get
Return Assembly.GetExecutingAssembly().GetName().Version.ToString()
End Get
End Property
Public ReadOnly Property AssemblyDescription() As String
Get
Dim attributes As Object() = Assembly.GetExecutingAssembly().GetCustomAttributes(GetType(AssemblyDescriptionAttribute), False)
If attributes.Length = 0 Then
Return ""
End If
Return DirectCast(attributes(0), AssemblyDescriptionAttribute).Description
End Get
End Property
Public ReadOnly Property AssemblyProduct() As String
Get
Dim attributes As Object() = Assembly.GetExecutingAssembly().GetCustomAttributes(GetType(AssemblyProductAttribute), False)
If attributes.Length = 0 Then
Return ""
End If
Return DirectCast(attributes(0), AssemblyProductAttribute).Product
End Get
End Property
Public ReadOnly Property AssemblyCopyright() As String
Get
Dim attributes As Object() = Assembly.GetExecutingAssembly().GetCustomAttributes(GetType(AssemblyCopyrightAttribute), False)
If attributes.Length = 0 Then
Return ""
End If
Return DirectCast(attributes(0), AssemblyCopyrightAttribute).Copyright
End Get
End Property
Public ReadOnly Property AssemblyCompany() As String
Get
Dim attributes As Object() = Assembly.GetExecutingAssembly().GetCustomAttributes(GetType(AssemblyCompanyAttribute), False)
If attributes.Length = 0 Then
Return ""
End If
Return DirectCast(attributes(0), AssemblyCompanyAttribute).Company
End Get
End Property
#End Region
End Class