Revision 5a99309c trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
381 | 381 |
if (Directory.Exists(oldPath)) |
382 | 382 |
{ |
383 | 383 |
//If it does, do the move |
384 |
Directory.Move(oldPath, newPath); |
|
384 |
|
|
385 |
//Now Create all of the directories |
|
386 |
foreach (string dirPath in Directory.EnumerateDirectories(oldPath, "*", |
|
387 |
SearchOption.AllDirectories)) |
|
388 |
Directory.CreateDirectory(dirPath.Replace(oldPath, newPath)); |
|
389 |
|
|
390 |
//Copy all the files |
|
391 |
foreach (string newFilePath in Directory.EnumerateFiles(oldPath, "*.*", |
|
392 |
SearchOption.AllDirectories)) |
|
393 |
File.Copy(newFilePath, newFilePath.Replace(oldPath, newPath)); |
|
394 |
|
|
395 |
Directory.Delete(oldPath, true); |
|
396 |
|
|
385 | 397 |
//We also need to change the path of the existing file states |
386 | 398 |
if (monitor != null) |
387 | 399 |
monitor.MoveFileStates(oldPath, newPath); |
Also available in: Unified diff