Improve Base Form Properties, Improve PanelManager

This commit is contained in:
Jonathan Jenne
2019-03-11 14:49:48 +01:00
parent e7e6d73411
commit 896426da3b
15 changed files with 145 additions and 61 deletions

View File

@@ -14,8 +14,14 @@ Imports DigitalData.Modules.Logging
Public Class BaseForm
Inherits Form
Protected ReadOnly _Logger As Logger
Protected ReadOnly _ErrorHandler As ClassErrorHandler
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
Public Sub New()
' Get the full name of the inheriting form
@@ -30,4 +36,8 @@ Public Class BaseForm
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
End Class

View File

@@ -17,8 +17,14 @@ Imports DigitalData.Modules.Logging
Public Class BaseRibbonForm
Inherits RibbonForm
Protected ReadOnly _Logger As Logger
Protected ReadOnly _ErrorHandler As ClassErrorHandler
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
Public Sub New()
' Get the full name of the inheriting form
@@ -34,6 +40,17 @@ Public Class BaseRibbonForm
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
''' <summary>
''' Returns a list of panels that will be show when the form is opened.
''' This can be overridden by all inheriting forms to extend the list of panels
''' Panels will be created by PanelManager.
''' </summary>
''' <seealso cref="ClassPanelManager"/>
''' <returns>A list of PanelInformation</returns>
Public Overridable Function GetInitialPanels() As List(Of PanelInfo)
Return New List(Of PanelInfo)
End Function