Common: Improve BaseForms and ErrorHandler
This commit is contained in:
@@ -5,14 +5,16 @@ Imports DigitalData.Modules.Logging
|
||||
Namespace Base
|
||||
''' <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.:
|
||||
''' </summary>
|
||||
''' <example>
|
||||
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form.
|
||||
'''
|
||||
''' Partial Class frmExample
|
||||
''' Inherits BaseRibbonForm
|
||||
'''
|
||||
''' ...
|
||||
''' End Class
|
||||
''' </summary>
|
||||
''' </example>
|
||||
Public Class BaseRibbonForm
|
||||
Inherits RibbonForm
|
||||
|
||||
@@ -43,13 +45,18 @@ Namespace Base
|
||||
End Sub
|
||||
|
||||
''' ============== PUBLIC METHODS ==============
|
||||
Public Sub ShowInfoMessage(Message As String)
|
||||
_ErrorHandler.ShowInfoMessage(Message)
|
||||
End Sub
|
||||
|
||||
Public Sub ShowErrorMessage(Exception As Exception)
|
||||
_ErrorHandler.ShowErrorMessage(Exception)
|
||||
Dim oCallingClass = LogConfig.GetClassFullName(IncludeMethodNames:=True, Parts:=2)
|
||||
_ErrorHandler.ShowErrorMessage(Exception, oCallingClass)
|
||||
End Sub
|
||||
|
||||
Public Sub ShowErrorMessage(ErrorMessage As String)
|
||||
_ErrorHandler.ShowErrorMessage(New ApplicationException(ErrorMessage))
|
||||
Dim oCallingClass = LogConfig.GetClassFullName(IncludeMethodNames:=True, Parts:=2)
|
||||
_ErrorHandler.ShowErrorMessage(New ApplicationException(ErrorMessage), oCallingClass)
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user