2019-03-08 15:00:47 +01:00

44 lines
1.3 KiB
VB.net

Imports DevExpress.XtraBars.Docking
Imports DevExpress.XtraBars.Ribbon
Imports DigitalData.Modules.Logging
''' <summary>
''' This BaseClass is used to provide common functionality like the Logger or ErrorHandler to all Forms
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form, eg.:
'''
''' Partial Class frmExample
''' Inherits BaseRibbonForm
'''
''' ...
''' End Class
'''
''' Only BaseRibbonForms can have panels attached to it!
''' </summary>
Public Class BaseRibbonForm
Inherits RibbonForm
Protected ReadOnly _Logger As Logger
Protected ReadOnly _ErrorHandler As ClassErrorHandler
Public Sub New()
' Get the full name of the inheriting form
' so the log messages have the right classname
Dim oClassName = [GetType]().FullName
' My.LogConfig is undefined in the designer
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
' When you add something, be careful if it
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Overridable Function GetInitialPanels() As List(Of PanelInfo)
Return New List(Of PanelInfo)
End Function
End Class