Browse Source

SD2-900: Reloading non existant file throws exception

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1845 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 19 years ago
parent
commit
3e436eb1d7
  1. BIN
      data/resources/StringResources.es-mx.resources
  2. BIN
      data/resources/StringResources.es.resources
  3. BIN
      data/resources/StringResources.nl.resources
  4. 17
      src/Main/Base/Project/Src/Commands/FileCommands.cs
  5. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

17
src/Main/Base/Project/Src/Commands/FileCommands.cs

@ -91,7 +91,16 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -91,7 +91,16 @@ namespace ICSharpCode.SharpDevelop.Commands
if (window.ViewContent is IMementoCapable) {
memento = ((IMementoCapable)window.ViewContent).CreateMemento();
}
window.ViewContent.Load(window.ViewContent.FileName);
try
{
window.ViewContent.Load(window.ViewContent.FileName);
}
catch(FileNotFoundException)
{
MessageService.ShowWarning("${res:ICSharpCode.SharpDevelop.Commands.ReloadFile.FileDeletedMessage}");
return;
}
if (memento != null) {
((IMementoCapable)window.ViewContent).SetMemento(memento);
}
@ -128,12 +137,12 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -128,12 +137,12 @@ namespace ICSharpCode.SharpDevelop.Commands
}
if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
string fileName = fdiag.FileName;
string fileName = fdiag.FileName;
if (!FileService.CheckFileName(fileName)) {
return;
}
}
if (FileUtility.ObservedSave(new NamedFileOperationDelegate(window.ViewContent.Save), fileName) == FileOperationResult.OK) {
FileService.RecentOpen.AddLastFile(fileName);
FileService.RecentOpen.AddLastFile(fileName);
MessageService.ShowMessage(fileName, "${res:ICSharpCode.SharpDevelop.Commands.SaveFile.FileSaved}");
}
}

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save