Imports System.Reflection

Public Class AcercaDe
  Public Sub New()
    InitializeComponent()

    ' Atributos globales
    Me.Title = DirectCast(ObtenerInfo(GetType(AssemblyTitleAttribute)), AssemblyTitleAttribute).Title
    Me.etNombreProd.Content = "Nombre del producto:  " + DirectCast(ObtenerInfo(GetType(AssemblyProductAttribute)), AssemblyProductAttribute).Product
    Me.etVersion.Content = "Versión:  " + DirectCast(ObtenerInfo(GetType(AssemblyFileVersionAttribute)), AssemblyFileVersionAttribute).Version
    Me.etCopyright.Content = DirectCast(ObtenerInfo(GetType(AssemblyCopyrightAttribute)), AssemblyCopyrightAttribute).Copyright
    Me.etNombreEmpr.Content = "Nombre de la empresa: " + DirectCast(ObtenerInfo(GetType(AssemblyCompanyAttribute)), AssemblyCompanyAttribute).Company
    Me.bktDescrip_sec1.Text = DirectCast(ObtenerInfo(GetType(AssemblyDescriptionAttribute)), AssemblyDescriptionAttribute).Description
  End Sub

  Private Function ObtenerInfo(atributo As Type, Optional h As Boolean = False) As Object
    ' Atributos globales
    Dim ensamblado As Assembly = Assembly.GetExecutingAssembly()
    Dim atributos As Object() = ensamblado.GetCustomAttributes(atributo, h)
    Return atributos(0)
  End Function

  Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
    Close()
  End Sub
End Class
