From 535ffd4978fde102ab5163036505aa753ac5c877 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 19 Apr 2007 14:14:22 +0000 Subject: [PATCH] Fixed build. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2495 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Src/Commands/ProjectBrowserCommands.cs | 23 ++++++++++--------- .../Base/Project/Src/Commands/FileCommands.cs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/ProjectBrowserCommands.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/ProjectBrowserCommands.cs index 2fe8984e64..0a250e91f7 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/ProjectBrowserCommands.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/ProjectBrowserCommands.cs @@ -11,6 +11,7 @@ using System.IO; using System.Text; using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; using NSvn.Common; @@ -33,16 +34,17 @@ namespace ICSharpCode.Svn.Commands nodeFileName = ((SolutionNode)node).Solution.Directory; } if (nodeFileName != null) { - List unsavedViewContents = new List(); - foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection) { - if (string.IsNullOrEmpty(vc.FileName)) continue; - if (FileUtility.IsUrl(vc.FileName)) continue; - if (vc.IsDirty == false) continue; - if (FileUtility.IsBaseDirectory(nodeFileName, vc.FileName)) { - unsavedViewContents.Add(vc); + List unsavedFiles = new List(); + foreach (OpenedFile file in FileService.OpenedFiles) { + if (file.IsDirty && !file.IsUntitled) { + if (string.IsNullOrEmpty(file.FileName)) continue; + if (FileUtility.IsUrl(file.FileName)) continue; + if (FileUtility.IsBaseDirectory(nodeFileName, file.FileName)) { + unsavedFiles.Add(file); + } } } - if (unsavedViewContents.Count > 0) { + if (unsavedFiles.Count > 0) { if (MessageService.ShowCustomDialog( MessageService.DefaultMessageBoxTitle, "The version control operation would affect files with unsaved modifications.\n" + @@ -52,9 +54,8 @@ namespace ICSharpCode.Svn.Commands == 0) { // Save - foreach (IViewContent vc in unsavedViewContents) { - ProjectService.MarkFileDirty(vc.FileName); - FileUtility.ObservedSave(new FileOperationDelegate(vc.Save), vc.FileName, FileErrorPolicy.ProvideAlternative); + foreach (OpenedFile file in unsavedFiles) { + SharpDevelop.Commands.SaveFile.Save(file); } } else { // Cancel diff --git a/src/Main/Base/Project/Src/Commands/FileCommands.cs b/src/Main/Base/Project/Src/Commands/FileCommands.cs index be07c344cb..829f482652 100644 --- a/src/Main/Base/Project/Src/Commands/FileCommands.cs +++ b/src/Main/Base/Project/Src/Commands/FileCommands.cs @@ -75,7 +75,7 @@ namespace ICSharpCode.SharpDevelop.Commands } } - internal static void Save(OpenedFile file) + public static void Save(OpenedFile file) { if (file.IsUntitled) { SaveFileAs.Save(file);