directories per template, export tweaks

This commit is contained in:
Jonathan Jenne
2021-12-22 15:38:05 +01:00
parent 9a3761acc0
commit 79cfec3173
30 changed files with 1158 additions and 257 deletions

View File

@@ -3,9 +3,11 @@ Imports MultiTool.Shared.Exceptions
Public Class FormHelper
Private ReadOnly Logger As Logger
Private ReadOnly Form As Windows.Forms.Form
Public Sub New(pLogConfig As LogConfig)
Public Sub New(pLogConfig As LogConfig, pForm As Windows.Forms.Form)
Logger = pLogConfig.GetLogger()
Form = pForm
End Sub
Public Sub ShowError(pException As Exception, pFunction As String, Optional pDetails As String = "")
@@ -24,7 +26,7 @@ Public Class FormHelper
End If
Logger.Error(pException)
MsgBox(oMessage, MsgBoxStyle.Critical, Application.ProductName)
MsgBox(oMessage, MsgBoxStyle.Critical, Form.Text)
End Sub
Public Sub ShowWarning(pMessage As String, Optional pDetails As String = "")
@@ -34,7 +36,25 @@ Public Class FormHelper
End If
Logger.Info(oMessage)
MsgBox(oMessage, MsgBoxStyle.Exclamation, Application.ProductName)
MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text)
End Sub
Public Sub TryOpenDirectory(pPath As String, pDisplayName As String)
If IO.Directory.Exists(pPath) Then
Process.Start(pPath)
Else
Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName)
MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text)
End If
End Sub
Public Sub TryOpenFile(pPath As String, pDisplayName As String)
If IO.File.Exists(pPath) Then
Process.Start(pPath)
Else
Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName)
MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text)
End If
End Sub
End Class