Safely migrate panel layout file from Local to Roaming folder.

This commit is contained in:
Riley McArdle
2011-05-12 17:50:45 -05:00
parent 4f9e6ebbd4
commit 944906a594

View File

@@ -160,8 +160,13 @@ Namespace Config
Loop
Startup.CreatePanels()
If File.Exists(App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName) And My.Settings.ResetPanels = False Then
.pnlDock.LoadFromXml(App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName, AddressOf GetContentFromPersistString)
Dim oldPath As String = GetFolderPath(SpecialFolder.LocalApplicationData) & "\" & My.Application.Info.ProductName & "\" & App.Info.Settings.LayoutFileName
Dim newPath As String = App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName
If File.Exists(newPath) Then
.pnlDock.LoadFromXml(newPath, AddressOf GetContentFromPersistString)
ElseIf File.Exists(oldPath) Then
.pnlDock.LoadFromXml(oldPath, AddressOf GetContentFromPersistString)
Else
Startup.SetDefaultLayout()
End If