Workspace: add reset workspace

This commit is contained in:
Jonathan Jenne 2022-07-12 16:39:08 +02:00
parent f1abc1ca58
commit d718152a3f

View File

@ -19,7 +19,7 @@ Namespace DocumentResultList
Public Const WORKSPACE_DIRECTORY As String = "Workspaces"
Public Const DEFAULT_WORKSPACE As String = "Default"
Private _CurrentWorkspace = Nothing
Private _CurrentWorkspace As String = Nothing
Public Event WorkspaceLoaded As EventHandler(Of String)
@ -127,6 +127,25 @@ Namespace DocumentResultList
End Try
End Function
Public Function ResetWorkspace(pName As String) As Boolean
Try
Dim oFilePath = GetWorkspacePath(pName)
Manager.RemoveWorkspace(pName)
If IO.File.Exists(oFilePath) = False Then
Logger.Debug("Workspace does not exist!")
Return True
End If
IO.File.Delete(oFilePath)
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function LoadWorkspaces() As Boolean
Try
Dim oFilePath = GetWorkspaceDirectoryPath()