Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Data.Filtering

Public Class AboutInfoCustomizationVC
    Inherits DevExpress.ExpressApp.WindowController

     Public Sub New()
        MyBase.New()

        'This call is required by the Component Designer.
        InitializeComponent()
        RegisterActions(components)

    End Sub
    Protected Overrides Sub OnActivated()
        MyBase.OnActivated()
        AboutInfo.Instance.AboutInfoString = GetCustomAboutString()
    End Sub
    Function GetCustomAboutString() As String
        Dim _CustomAboutString As String = ""
        Dim _User As User
        Dim _Contacts As Contacts
        Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
        Dim _PartnerInfo As String = ""

        _User = _onew.GetObject(TryCast(SecuritySystem.CurrentUser, User))

        If _User IsNot Nothing Then
            _Contacts = _onew.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
            If _Contacts IsNot Nothing Then
                _PartnerInfo = _Contacts.Customers.FullName
            End If
        End If

        _CustomAboutString = TryCast(SecuritySystem.CurrentUser, User).FullName & "<br>"
        _CustomAboutString += "<b>" & _PartnerInfo & "</b><br><br>"
        _CustomAboutString += Application.Model.Application.Description & "<br>"
        _CustomAboutString += "Version: " & System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.ToString & "<br>"
        _CustomAboutString += "Copyright (C) " & Application.Model.Copyright

        Return _CustomAboutString
    End Function

End Class
