32 lines
858 B
VB.net

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
''' </summary>
Public Class BaseRibbonForm
Inherits RibbonForm
Protected ReadOnly _Logger As Logger
Protected ReadOnly _ErrorHandler As ClassErrorHandler
Public Sub New()
Dim oClassName = [GetType]().Name
' My.LogConfig is undefined in the designer
' so we need to check with ?
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
End Sub
End Class