Modules/ZooFlow/frmMain.vb
2019-09-10 16:27:31 +02:00

94 lines
3.0 KiB
VB.net

Imports System.ComponentModel
Imports DevExpress.XtraSplashScreen
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Filesystem
Imports DigitalData.Modules.Database
Imports DevExpress.LookAndFeel
Imports ZooFlow.ClassConstants
Partial Public Class frmMain
Private WithEvents FlowForm As frmFlowForm
Private Init As ClassInit
Private Loading As Boolean = True
Private Logger As Logger = My.LogConfig.GetLogger
Public Sub New()
InitializeComponent()
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' === Initialization ===
Init = New ClassInit(My.LogConfig, Me)
AddHandler Init.Completed, AddressOf Init_Completed
Init.InitializeApplication()
' === Layout and Skin ===
UserLookAndFeel.Default.SetSkinStyle(My.UIConfig.SkinName)
End Sub
Private Sub Init_Completed(sender As Object, e As EventArgs)
' Initialization Complete
Loading = False
SplashScreenManager.CloseForm(False)
' Setup Flow Form
FlowForm = New frmFlowForm(My.Application.ModulesActive)
FlowForm.Show()
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Hide()
End Sub
Private Sub FlowForm_ClipboardChanged(sender As Object, e As IDataObject) Handles FlowForm.ClipboardChanged
MsgBox("Clipboard Changed!")
End Sub
#Region "Notify Icon Menu"
Private Sub BeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BeendenToolStripMenuItem.Click
Application.Exit()
End Sub
Private Sub NotifyIconMain_DoubleClick(sender As Object, e As EventArgs) Handles NotifyIconMain.DoubleClick
ToggleVisibility()
End Sub
Private Sub AnzeigenVersteckenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AnzeigenVersteckenToolStripMenuItem.Click
ToggleVisibility()
End Sub
#End Region
Private Sub ToggleVisibility()
If Visible Then
Hide()
Else
Show()
BringToFront()
End If
End Sub
Private Sub ProgressChanged(sender As Object, Progress As ClassInitLoader.InitProgress)
SplashScreenManager.Default.SendCommand(frmSplash.SplashScreenCommand.SetProgress, Progress.CurrentPercent)
SplashScreenManager.Default.SendCommand(frmSplash.SplashScreenCommand.SetActionName, Progress.CurrentStep.Name)
End Sub
Private Sub ButtonSettings_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonSettings.ItemClick
frmSettings.ShowDialog()
End Sub
Private Sub ButtonExit_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonExit.ItemClick
End Sub
Private Sub frmMain_StyleChanged(sender As Object, e As EventArgs) Handles Me.StyleChanged
If Loading = False Then
My.UIConfig.SkinName = LookAndFeel.ActiveSkinName
My.UIConfigManager.Save()
End If
End Sub
End Class