small fixes
This commit is contained in:
@@ -15,13 +15,13 @@ Public Class ClassErrorHandler
|
||||
|
||||
oMessage &= $"Form: {oFormName}{vbNewLine}"
|
||||
oMessage &= $"Method: {oMethodName}{vbNewLine}"
|
||||
oMessage &= $"{Exception.Message}{vbNewLine}{Exception.StackTrace}{vbNewLine}{vbNewLine}"
|
||||
oMessage &= $"{Exception.Message}{vbNewLine}"
|
||||
oMessage &= $"{Exception.StackTrace}{vbNewLine}{vbNewLine}"
|
||||
oMessage &= $"Please report this error to error@digitaldata.works"
|
||||
|
||||
Return oMessage
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub ShowErrorMessage(Exception As Exception)
|
||||
_Logger.Error(Exception)
|
||||
MsgBox(GetMessage(Exception), MsgBoxStyle.Critical, "Unexpected Error")
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
Public Class ClassUIConfig
|
||||
Public Property SkinName As String = "Office 2016 Colorful"
|
||||
|
||||
'Public Property EditFormConfigs As New List(Of KeyValuePair(Of String, EditFormConfig))
|
||||
Public Property EditFormConfigs As New List(Of EditFormConfig)
|
||||
|
||||
Public Class EditFormConfig
|
||||
|
||||
@@ -18,11 +18,16 @@ Public Class BaseForm
|
||||
Protected ReadOnly _ErrorHandler As ClassErrorHandler
|
||||
|
||||
Public Sub New()
|
||||
Dim oClassName = [GetType]().Name
|
||||
' 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
|
||||
' so we need to check with ?
|
||||
' 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
|
||||
End Class
|
||||
@@ -18,12 +18,17 @@ Public Class BaseRibbonForm
|
||||
Protected ReadOnly _ErrorHandler As ClassErrorHandler
|
||||
|
||||
Public Sub New()
|
||||
Dim oClassName = [GetType]().Name
|
||||
' 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
|
||||
' so we need to check with ?
|
||||
' 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
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user