From 06b61ceb90c741c2e4e99b6713eb65dac0e6c92b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 30 Sep 2007 15:07:14 +0000 Subject: [PATCH] Fixed forum-19066: Invalid params for External Tools. Changed some instances of "combine" to "solution". git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2707 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../XmlEditor/Project/Src/XmlView.cs | 4 +-- .../Project/ICSharpCode.SharpDevelop.csproj | 2 +- .../Project/Src/Commands/AutostartCommands.cs | 12 +++---- .../Src/Commands/CustomStringTagProvider.cs | 27 ++++++++++++--- .../Project/Src/Commands/MenuItemBuilders.cs | 27 --------------- .../Src/Gui/Dialogs/NewProjectDialog.cs | 8 ++--- .../Dialogs/OptionPanels/ExternalToolPanel.cs | 6 ++-- .../Src/Gui/Dialogs/WordCountDialog.cs | 6 ++-- .../Src/Gui/Pads/ErrorList/ErrorListPad.cs | 8 ++--- .../Src/Gui/Pads/PropertyPad/PropertyPad.cs | 6 ++-- .../Src/Gui/Pads/TaskList/TaskListPad.cs | 8 ++--- .../Project/ProjectCreateInformation.cs | 6 ++-- .../Templates/Project/ProjectDescriptor.cs | 2 +- .../Templates/Project/ProjectTemplate.cs | 18 +++++----- ...ineDescriptor.cs => SolutionDescriptor.cs} | 34 +++++++++---------- .../ClassBrowserIconService.cs | 2 +- .../Services/ParserService/ParserService.cs | 3 +- .../Services/StatusBar/StatusBarService.cs | 6 ++-- .../Gui/Editor/TextEditorDisplayBinding.cs | 2 +- 19 files changed, 89 insertions(+), 98 deletions(-) rename src/Main/Base/Project/Src/Internal/Templates/Project/{CombineDescriptor.cs => SolutionDescriptor.cs} (81%) diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs index dd4c7c51ff..e048d926a9 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs @@ -154,7 +154,7 @@ namespace ICSharpCode.XmlEditor } public override bool IsReadOnly { - get { + get { return xmlEditor.IsReadOnly; } } @@ -782,7 +782,7 @@ namespace ICSharpCode.XmlEditor TextAreaControl activeTextAreaControl = xmlEditor.ActiveTextAreaControl; int line = activeTextAreaControl.Caret.Line; int col = activeTextAreaControl.Caret.Column; - StatusBarService.SetCaretPosition(activeTextAreaControl.TextArea.TextView.GetVisualColumn(line, col), line, col); + StatusBarService.SetCaretPosition(activeTextAreaControl.TextArea.TextView.GetVisualColumn(line, col) + 1, line + 1, col = 1); } /// diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index 4fbeb4971a..ee85f3b5db 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -136,7 +136,7 @@ - + diff --git a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs index 39b259a187..3bfb1d7e1a 100644 --- a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs +++ b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs @@ -79,12 +79,12 @@ namespace ICSharpCode.SharpDevelop.Commands { //WorkbenchSingleton.MainForm.Show(); - bool didLoadCombineOrFile = false; + bool didLoadSolutionOrFile = false; NavigationService.SuspendLogging(); foreach (string file in fileList) { - didLoadCombineOrFile = true; + didLoadSolutionOrFile = true; try { IProjectLoader loader = ProjectService.GetProjectLoader(file); if (loader != null) { @@ -97,15 +97,15 @@ namespace ICSharpCode.SharpDevelop.Commands } } - // load previous combine - if (!didLoadCombineOrFile && PropertyService.Get("SharpDevelop.LoadPrevProjectOnStartup", false)) { + // load previous solution + if (!didLoadSolutionOrFile && PropertyService.Get("SharpDevelop.LoadPrevProjectOnStartup", false)) { if (FileService.RecentOpen.RecentProject.Count > 0) { ProjectService.LoadSolution(FileService.RecentOpen.RecentProject[0].ToString()); - didLoadCombineOrFile = true; + didLoadSolutionOrFile = true; } } - if (!didLoadCombineOrFile) { + if (!didLoadSolutionOrFile) { foreach (ICommand command in AddInTree.BuildItems("/Workspace/AutostartNothingLoaded", null, false)) { command.Run(); } diff --git a/src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs b/src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs index cd1c02bb27..98cd11b4bb 100644 --- a/src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs +++ b/src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs @@ -24,6 +24,7 @@ namespace ICSharpCode.SharpDevelop.Commands "CurrentProjectName", "ProjectDir", "ProjectFilename", "CombineDir", "CombineFilename", + "SolutionDir", "SolutionFilename", "Startuppath", "TaskService.Warnings", "TaskService.Errors", "TaskService.Messages", "NetSdkDir" @@ -92,14 +93,28 @@ namespace ICSharpCode.SharpDevelop.Commands } catch (Exception) {} break; - // TODO: case "CURLINE": - return String.Empty; + { + IPositionable positionable = WorkbenchSingleton.Workbench.ActiveViewContent as IPositionable; + if (positionable != null) + return (positionable.Line + 1).ToString(); + break; + } case "CURCOL": - return String.Empty; + { + IPositionable positionable = WorkbenchSingleton.Workbench.ActiveViewContent as IPositionable; + if (positionable != null) + return (positionable.Column + 1).ToString(); + break; + } case "CURTEXT": - return String.Empty; - + { + var tecp = WorkbenchSingleton.Workbench.ActiveViewContent as DefaultEditor.Gui.Editor.ITextEditorControlProvider; + if (tecp != null) { + return tecp.TextEditorControl.ActiveTextAreaControl.SelectionManager.SelectedText; + } + break; + } case "TARGETPATH": try { return GetCurrentTargetPath(); @@ -135,7 +150,9 @@ namespace ICSharpCode.SharpDevelop.Commands break; case "COMBINEDIR": + case "SOLUTIONDIR": return Path.GetDirectoryName(ProjectService.OpenSolution.FileName); + case "SOLUTIONFILENAME": case "COMBINEFILENAME": try { return Path.GetFileName(ProjectService.OpenSolution.FileName); diff --git a/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs b/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs index 54d87e20ca..dc699a8254 100644 --- a/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs +++ b/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs @@ -235,33 +235,6 @@ namespace ICSharpCode.SharpDevelop.Commands if (item.Text == ToolLoader.Tool[i].ToString()) { ExternalTool tool = (ExternalTool)ToolLoader.Tool[i]; - string fileName = WorkbenchSingleton.Workbench.ActiveViewContent.PrimaryFileName; - StringParser.Properties["ItemPath"] = fileName == null ? String.Empty : fileName; - StringParser.Properties["ItemDir"] = fileName == null ? String.Empty : Path.GetDirectoryName(fileName); - StringParser.Properties["ItemFileName"] = fileName == null ? String.Empty : Path.GetFileName(fileName); - StringParser.Properties["ItemExt"] = fileName == null ? String.Empty : Path.GetExtension(fileName); - - // TODO: - StringParser.Properties["CurLine"] = "0"; - StringParser.Properties["CurCol"] = "0"; - StringParser.Properties["CurText"] = "0"; - - string targetPath = ProjectService.CurrentProject == null ? null : ProjectService.CurrentProject.OutputAssemblyFullPath; - StringParser.Properties["TargetPath"] = targetPath == null ? String.Empty : targetPath; - StringParser.Properties["TargetDir"] = targetPath == null ? String.Empty : Path.GetDirectoryName(targetPath); - StringParser.Properties["TargetName"] = targetPath == null ? String.Empty : Path.GetFileName(targetPath); - StringParser.Properties["TargetExt"] = targetPath == null ? String.Empty : Path.GetExtension(targetPath); - - string projectFileName = ProjectService.CurrentProject == null ? null : ProjectService.CurrentProject.FileName; - StringParser.Properties["ProjectDir"] = projectFileName == null ? null : Path.GetDirectoryName(projectFileName); - StringParser.Properties["ProjectFileName"] = projectFileName == null ? null : projectFileName; - - string combineFileName = ProjectService.OpenSolution == null ? null : ProjectService.OpenSolution.FileName; - StringParser.Properties["CombineDir"] = combineFileName == null ? null : Path.GetDirectoryName(combineFileName); - StringParser.Properties["CombineFileName"] = combineFileName == null ? null : combineFileName; - - StringParser.Properties["StartupPath"] = Application.StartupPath; - string command = StringParser.Parse(tool.Command); string args = StringParser.Parse(tool.Arguments); diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs index a153c366f2..df7d6bb589 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs @@ -258,7 +258,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs } public string NewProjectLocation; - public string NewCombineLocation; + public string NewSolutionLocation; void OpenEvent(object sender, EventArgs e) { @@ -313,12 +313,12 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs cinfo.ProjectName = name; - NewCombineLocation = item.Template.CreateProject(cinfo); - if (NewCombineLocation == null || NewCombineLocation.Length == 0) { + NewSolutionLocation = item.Template.CreateProject(cinfo); + if (NewSolutionLocation == null || NewSolutionLocation.Length == 0) { return; } if (createNewSolution) { - ProjectService.LoadSolutionOrProject(NewCombineLocation); + ProjectService.LoadSolutionOrProject(NewSolutionLocation); item.Template.RunOpenActions(cinfo); } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs index 0a613efe14..42d10b0f9b 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs @@ -35,8 +35,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.ProjectDirectory}", "${ProjectDir}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.ProjectFileName}", "${ProjectFileName}"}, {"-", ""}, - {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${CombineDir}"}, - {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineFileName}", "${CombineFileName}"}, + {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${SolutionDir}"}, + {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineFileName}", "${SolutionFileName}"}, {"-", ""}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.SharpDevelopStartupPath}", "${StartupPath}"}, }; @@ -49,7 +49,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels {"-", ""}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.ProjectDirectory}", "${ProjectDir}"}, {"-", ""}, - {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${CombineDir}"}, + {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${SolutionDir}"}, {"-", ""}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.SharpDevelopStartupPath}", "${StartupPath}"}, }; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs index 39aba8a2a1..5d4f63bc80 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs @@ -131,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.Gui break; } total = new Report(StringParser.Parse("${res:Dialog.WordCountDialog.TotalText}"), 0, 0, 0); - CountCombine(ProjectService.OpenSolution, ref total); + CountSolution(ProjectService.OpenSolution, ref total); // ((ListView)ControlDictionary["resultListView"]).Items.Add(new ListViewItem("")); // ((ListView)ControlDictionary["resultListView"]).Items.Add(all.ToListItem()); break; @@ -140,9 +140,9 @@ namespace ICSharpCode.SharpDevelop.Gui UpdateList(0); } - void CountCombine(Solution combine, ref Report all) + void CountSolution(Solution solution, ref Report all) { - foreach (IProject project in combine.Projects) { + foreach (IProject project in solution.Projects) { foreach (ProjectItem item in project.Items) { if (item.ItemType == ItemType.Compile) { Report r = GetReport(item.FileName); diff --git a/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs b/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs index 0b4e328586..5de7cbd086 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs @@ -91,8 +91,8 @@ namespace ICSharpCode.SharpDevelop.Gui }; ProjectService.EndBuild += ProjectServiceEndBuild; - ProjectService.SolutionLoaded += OnCombineOpen; - ProjectService.SolutionClosed += OnCombineClosed; + ProjectService.SolutionLoaded += OnSolutionOpen; + ProjectService.SolutionClosed += OnSolutionClosed; taskView.CreateControl(); contentPanel.Controls.Add(taskView); @@ -111,13 +111,13 @@ namespace ICSharpCode.SharpDevelop.Gui taskView.RefreshColumnNames(); } - void OnCombineOpen(object sender, SolutionEventArgs e) + void OnSolutionOpen(object sender, SolutionEventArgs e) { taskView.ClearTasks(); UpdateToolstripStatus(); } - void OnCombineClosed(object sender, EventArgs e) + void OnSolutionClosed(object sender, EventArgs e) { try { taskView.ClearTasks(); diff --git a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs index 040ba160c6..e7234b33a7 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs @@ -183,7 +183,7 @@ namespace ICSharpCode.SharpDevelop.Gui panel.Controls.Add(grid); panel.Controls.Add(comboBox); - ProjectService.SolutionClosed += CombineClosedEvent; + ProjectService.SolutionClosed += SolutionClosedEvent; grid.PropertyValueChanged += new PropertyValueChangedEventHandler(PropertyChanged); grid.ContextMenuStrip = MenuService.CreateContextMenu(this, "/SharpDevelop/Views/PropertyPad/ContextMenu"); @@ -197,7 +197,7 @@ namespace ICSharpCode.SharpDevelop.Gui WorkbenchActiveContentChanged(null, null); } - void CombineClosedEvent(object sender, EventArgs e) + void SolutionClosedEvent(object sender, EventArgs e) { SetDesignableObjects(null); } @@ -300,7 +300,7 @@ namespace ICSharpCode.SharpDevelop.Gui { base.Dispose(); if (grid != null) { - ProjectService.SolutionClosed -= CombineClosedEvent; + ProjectService.SolutionClosed -= SolutionClosedEvent; try { grid.SelectedObjects = null; } catch {} diff --git a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs index d9d0d23af6..f1ade42607 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs @@ -29,8 +29,8 @@ namespace ICSharpCode.SharpDevelop.Gui TaskService.Added += new TaskEventHandler(TaskServiceAdded); TaskService.Removed += new TaskEventHandler(TaskServiceRemoved); - ProjectService.SolutionLoaded += OnCombineOpen; - ProjectService.SolutionClosed += OnCombineClosed; + ProjectService.SolutionLoaded += OnSolutionOpen; + ProjectService.SolutionClosed += OnSolutionClosed; InternalShowResults(null, null); } @@ -40,12 +40,12 @@ namespace ICSharpCode.SharpDevelop.Gui taskView.RefreshColumnNames(); } - void OnCombineOpen(object sender, SolutionEventArgs e) + void OnSolutionOpen(object sender, SolutionEventArgs e) { taskView.ClearTasks(); } - void OnCombineClosed(object sender, EventArgs e) + void OnSolutionClosed(object sender, EventArgs e) { taskView.ClearTasks(); } diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs index f2d41bcfbe..6262b6fd4d 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs @@ -22,7 +22,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates public class ProjectCreateInformation { string projectName; - string combinePath; + string solutionPath; string projectBasePath; string outputProjectFileName; string rootNamespace; @@ -59,10 +59,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates public string SolutionPath { get { - return combinePath; + return solutionPath; } set { - combinePath = value; + solutionPath = value; } } diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs index 76464ffe34..14208806ea 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs @@ -20,7 +20,7 @@ using MSBuild = Microsoft.Build.BuildEngine; namespace ICSharpCode.SharpDevelop.Internal.Templates { /// - /// This class is used inside the combine templates for projects. + /// This class is used inside the solution templates for projects. /// public sealed class ProjectDescriptor { diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs index 87a5e672b3..b2867b347d 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates ArrayList actions = new ArrayList(); - CombineDescriptor combineDescriptor = null; + SolutionDescriptor solutionDescriptor = null; ProjectDescriptor projectDescriptor = null; #region Template Properties @@ -159,9 +159,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates [Browsable(false)] - public CombineDescriptor CombineDescriptor { + public SolutionDescriptor SolutionDescriptor { get { - return combineDescriptor; + return solutionDescriptor; } } @@ -221,9 +221,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates string hintPath = Path.GetDirectoryName(xmlFileName); if (templateElement["Solution"] != null) { - combineDescriptor = CombineDescriptor.CreateCombineDescriptor(templateElement["Solution"], hintPath); + solutionDescriptor = SolutionDescriptor.CreateSolutionDescriptor(templateElement["Solution"], hintPath); } else if (templateElement["Combine"] != null) { - combineDescriptor = CombineDescriptor.CreateCombineDescriptor(templateElement["Combine"], hintPath); + solutionDescriptor = SolutionDescriptor.CreateSolutionDescriptor(templateElement["Combine"], hintPath); WarnObsoleteNode(templateElement["Combine"], "Use instead!"); } @@ -231,8 +231,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates projectDescriptor = new ProjectDescriptor(templateElement["Project"], hintPath); } - if (combineDescriptor == null && projectDescriptor == null - || combineDescriptor != null && projectDescriptor != null) + if (solutionDescriptor == null && projectDescriptor == null + || solutionDescriptor != null && projectDescriptor != null) { throw new TemplateLoadException("Template must contain either Project or Solution node!"); } @@ -281,8 +281,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates return null; } } - if (combineDescriptor != null) { - return combineDescriptor.CreateSolution(projectCreateInformation, this.languagename); + if (solutionDescriptor != null) { + return solutionDescriptor.CreateSolution(projectCreateInformation, this.languagename); } else if (projectDescriptor != null) { projectCreateInformation.Solution = new Solution(); IProject project = projectDescriptor.CreateProject(projectCreateInformation, this.languagename); diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/CombineDescriptor.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs similarity index 81% rename from src/Main/Base/Project/Src/Internal/Templates/Project/CombineDescriptor.cs rename to src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs index aba69c9dda..897f8a4067 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/CombineDescriptor.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs @@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Project; namespace ICSharpCode.SharpDevelop.Internal.Templates { - public class CombineDescriptor + public class SolutionDescriptor { SolutionFolderDescriptor mainFolder = new SolutionFolderDescriptor(""); @@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } #endregion - protected CombineDescriptor(string name) + protected SolutionDescriptor(string name) { this.name = name; } @@ -97,11 +97,11 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates Solution newSolution = new Solution(); projectCreateInformation.Solution = newSolution; - string newCombineName = StringParser.Parse(name, new string[,] { + string newSolutionName = StringParser.Parse(name, new string[,] { {"ProjectName", projectCreateInformation.ProjectName} }); - newSolution.Name = newCombineName; + newSolution.Name = newSolutionName; string oldCombinePath = projectCreateInformation.SolutionPath; string oldProjectPath = projectCreateInformation.ProjectBasePath; @@ -124,35 +124,35 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates return null; } - string combineLocation = Path.Combine(projectCreateInformation.SolutionPath, newCombineName + ".sln"); - // Save combine - if (File.Exists(combineLocation)) { + string solutionLocation = Path.Combine(projectCreateInformation.SolutionPath, newSolutionName + ".sln"); + // Save solution + if (File.Exists(solutionLocation)) { - StringParser.Properties["combineLocation"] = combineLocation; + StringParser.Properties["combineLocation"] = solutionLocation; if (MessageService.AskQuestion("${res:ICSharpCode.SharpDevelop.Internal.Templates.CombineDescriptor.OverwriteProjectQuestion}")) { - newSolution.Save(combineLocation); + newSolution.Save(solutionLocation); } } else { - newSolution.Save(combineLocation); + newSolution.Save(solutionLocation); } newSolution.Dispose(); - return combineLocation; + return solutionLocation; } - public static CombineDescriptor CreateCombineDescriptor(XmlElement element, string hintPath) + public static SolutionDescriptor CreateSolutionDescriptor(XmlElement element, string hintPath) { - CombineDescriptor combineDescriptor = new CombineDescriptor(element.Attributes["name"].InnerText); + SolutionDescriptor solutionDescriptor = new SolutionDescriptor(element.Attributes["name"].InnerText); if (element.Attributes["directory"] != null) { - combineDescriptor.relativeDirectory = element.Attributes["directory"].InnerText; + solutionDescriptor.relativeDirectory = element.Attributes["directory"].InnerText; } if (element["Options"] != null && element["Options"]["StartupProject"] != null) { - combineDescriptor.startupProject = element["Options"]["StartupProject"].InnerText; + solutionDescriptor.startupProject = element["Options"]["StartupProject"].InnerText; } - combineDescriptor.mainFolder.Read(element, hintPath); - return combineDescriptor; + solutionDescriptor.mainFolder.Read(element, hintPath); + return solutionDescriptor; } } } diff --git a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs index 1cfa45c7fa..a6a820b407 100644 --- a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs +++ b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs @@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop public static class ClassBrowserIconService { public const int NamespaceIndex = 3; - public const int CombineIndex = 14; + public const int SolutionIndex = 14; public const int ConstIndex = 15; public const int GotoArrowIndex = 13; diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs index 96820da5f4..4b40cd4ae9 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs @@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop { if (loadSolutionProjectsThread != null) { if (!abortLoadSolutionProjectsThread) - throw new InvalidOperationException("Cannot open new combine without closing old combine!"); + throw new InvalidOperationException("Cannot open new solution without closing old solution!"); if (!loadSolutionProjectsThread.Join(50)) { // loadSolutionProjects might be waiting for main thread, so give it // a chance to complete safethread calls by putting this method at @@ -412,6 +412,7 @@ namespace ICSharpCode.SharpDevelop } IEditable editable = activeViewContent as IEditable; if (editable != null) { + #warning PrimaryFileName is not thread-safe, move all property accesses that are not guaranteed to be thread-safe into GetActiveViewContent string fileName = activeViewContent.PrimaryFileName; string text = null; diff --git a/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs b/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs index 79ed8aeb31..d90037c5ce 100644 --- a/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs +++ b/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs @@ -47,9 +47,9 @@ namespace ICSharpCode.SharpDevelop statusBar.CursorStatusBarPanel.Text = StringParser.Parse( "${res:StatusBarService.CursorStatusBarPanelText}", new string[,] { - {"Line", String.Format("{0,-10}", y + 1)}, - {"Column", String.Format("{0,-5}", x + 1)}, - {"Character", String.Format("{0,-5}", charOffset + 1)} + {"Line", String.Format("{0,-10}", y)}, + {"Column", String.Format("{0,-5}", x)}, + {"Character", String.Format("{0,-5}", charOffset)} }); } diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs index 3e257e1f3d..15c8c49f15 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs @@ -288,7 +288,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor TextAreaControl activeTextAreaControl = textEditorControl.ActiveTextAreaControl; int line = activeTextAreaControl.Caret.Line; int col = activeTextAreaControl.Caret.Column; - StatusBarService.SetCaretPosition(activeTextAreaControl.TextArea.TextView.GetVisualColumn(line, col), line, col); + StatusBarService.SetCaretPosition(activeTextAreaControl.TextArea.TextView.GetVisualColumn(line, col) + 1, line + 1, col + 1); NavigationService.Log(this.BuildNavPoint()); }