ZooFlow: Add Base Form
This commit is contained in:
34
GUIs.ZooFlow/Administration/frmAdmin_Base.vb
Normal file
34
GUIs.ZooFlow/Administration/frmAdmin_Base.vb
Normal file
@@ -0,0 +1,34 @@
|
||||
Imports DevExpress.XtraBars.Ribbon
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Partial Public MustInherit Class BaseForm
|
||||
Inherits RibbonForm
|
||||
|
||||
Private Logger As Logger
|
||||
|
||||
Public Sub New()
|
||||
Logger = My.LogConfig.GetLogger
|
||||
End Sub
|
||||
|
||||
Public Sub ShowInfo(Message As String)
|
||||
MessageBox.Show(Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
End Sub
|
||||
|
||||
Public Sub ShowError(Message As String)
|
||||
MessageBox.Show(Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
End Sub
|
||||
|
||||
Public Sub ShowError(Exception As Exception)
|
||||
Dim oCallingClass = LogConfig.GetClassFullName(IncludeMethodNames:=True)
|
||||
Logger.Error(Exception)
|
||||
ShowError($"Error in {oCallingClass}:{vbNewLine}{Exception.Message}")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class BaseFormImpl
|
||||
Inherits BaseForm
|
||||
End Class
|
||||
|
||||
Partial Public Class frmAdmin_Base
|
||||
Inherits BaseFormImpl
|
||||
End Class
|
||||
Reference in New Issue
Block a user