Async Data Loading, use ConfigManager

This commit is contained in:
Jonathan Jenne
2019-07-15 15:09:48 +02:00
parent be1f74ceb0
commit 2e296a5267
14 changed files with 309 additions and 267 deletions

View File

@@ -60,14 +60,14 @@ Public Class frmDocView
ResetSearch()
UpdateMainUi()
If My.Settings.frmViewerPosition.IsEmpty = False Then
If My.Settings.frmViewerPosition.X > 0 And My.Settings.frmViewerPosition.Y > 0 Then
Location = My.Settings.frmViewerPosition
End If
End If
If My.Settings.frmViewerSize.IsEmpty = False Then
Size = My.Settings.frmViewerSize
If ConfigManager.Config.ViewerWindowX > 0 And ConfigManager.Config.ViewerWindowY > 0 Then
Dim oLocation As New Point(ConfigManager.Config.ViewerWindowX, ConfigManager.Config.ViewerWindowY)
Location = oLocation
End If
Dim oSize As New Size(ConfigManager.Config.ViewerWindowWidth, ConfigManager.Config.ViewerWindowHeight)
Size = oSize
End Sub
Public Sub Load_File_from_Path(filepath As String)
@@ -755,10 +755,11 @@ Public Class frmDocView
Private Sub frmDocView_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
Try
' Position und Größe speichern
My.Settings.frmViewerSize = Me.Size
My.Settings.frmViewerPosition = Me.Location
My.Settings.Save()
ConfigManager.Config.ViewerWindowHeight = Size.Height
ConfigManager.Config.ViewerWindowWidth = Size.Width
ConfigManager.Config.ViewerWindowX = Location.X
ConfigManager.Config.ViewerWindowY = Location.Y
ConfigManager.Save()
Catch ex As Exception
Logger.Error(ex)
Logger.Info("Error in Save FormLayout: " & ex.Message)