49 lines
1.9 KiB
VB.net
49 lines
1.9 KiB
VB.net
Imports System.IO
|
|
Imports System.Reflection
|
|
Imports DevExpress.ExpressApp.Win.Utils
|
|
Imports DevExpress.Skins
|
|
Imports DevExpress.Utils.Drawing
|
|
|
|
Public Class XafSplashScreen
|
|
Sub New()
|
|
InitializeComponent()
|
|
LoadBlankLogo()
|
|
Me.labelCopyright.Text = "Copyright © 2008-" & DateTime.Now.Year.ToString()
|
|
UpdateLabelsPosition()
|
|
End Sub
|
|
Private Sub LoadBlankLogo()
|
|
Dim _assembly As Assembly = Assembly.GetExecutingAssembly()
|
|
Dim blankLogoResourceName As String = _assembly.GetName().Name & ".Logo.svg"
|
|
Dim svgStream As Stream = _assembly.GetManifestResourceStream(blankLogoResourceName)
|
|
If svgStream IsNot Nothing Then
|
|
svgStream.Position = 0
|
|
'peLogo.SvgImage = SvgImage.FromStream(svgStream)
|
|
End If
|
|
End Sub
|
|
Protected Overrides Sub DrawContent(graphicsCache As GraphicsCache, skin As Skin)
|
|
Dim bounds As Rectangle = ClientRectangle
|
|
bounds.Width = (bounds.Width - 1)
|
|
bounds.Height = (bounds.Height - 1)
|
|
graphicsCache.Graphics.DrawRectangle(graphicsCache.GetPen(Color.FromArgb(255, 87, 87, 87), 1), bounds)
|
|
End Sub
|
|
Protected Sub UpdateLabelsPosition()
|
|
labelApplicationName.CalcBestSize()
|
|
Dim newLeft As Integer = CType((Width - labelApplicationName.Width) / 2, Integer)
|
|
labelApplicationName.Location = New Point(newLeft, labelApplicationName.Top)
|
|
labelSubtitle.CalcBestSize()
|
|
newLeft = CType((Width - labelSubtitle.Width) / 2, Integer)
|
|
Me.labelSubtitle.Location = New Point(newLeft, labelSubtitle.Top)
|
|
|
|
End Sub
|
|
Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal arg As Object)
|
|
MyBase.ProcessCommand(cmd, arg)
|
|
If (CType(cmd, UpdateSplashCommand) = UpdateSplashCommand.Description) Then
|
|
labelStatus.Text = CType(arg, String)
|
|
End If
|
|
End Sub
|
|
|
|
Public Enum SplashScreenCommand
|
|
SomeCommandId
|
|
End Enum
|
|
End Class
|