Imports System.ComponentModel
Imports DigitalData.Modules.Logging

Public Class Form3
    Private _frm4 As Form4
    Public FilePath As String
    Private Key As String
    Private LogConfig As LogConfig
    Private Logger As Logger

    Public Sub New(LogConfig As LogConfig, Key As String)
        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()

        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
        Me.LogConfig = LogConfig
        Me.Key = Key
        _frm4 = New Form4(LogConfig, Key)
    End Sub

    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Logger = LogConfig.GetLogger
        Logger.Info("DocumentViewer Form Loaded")
        DocumentViewer1.Init(LogConfig, Key)
        DocumentViewer1.LoadFile(FilePath)
        DocumentViewer1.RightOnlyView(True)

        Logger.Info("File Loaded")
    End Sub

    Private Sub Form2_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
        Logger.Info("Form closed")
    End Sub

    Private Sub Form2_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        DocumentViewer1.Done()
        Logger.Info("Form closing")
        _frm4.Close()
    End Sub

    Private Sub Form3_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        _frm4.FilePath = FilePath
        _frm4.Show()

    End Sub
End Class