Browse Source

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
shortcuts
Daniel Grunwald 19 years ago
parent
commit
06b61ceb90
  1. 4
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
  2. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  3. 12
      src/Main/Base/Project/Src/Commands/AutostartCommands.cs
  4. 27
      src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs
  5. 27
      src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs
  6. 8
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  7. 6
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs
  8. 6
      src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs
  9. 8
      src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs
  10. 6
      src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs
  11. 8
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
  12. 6
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs
  13. 2
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  14. 18
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
  15. 34
      src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs
  16. 2
      src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs
  17. 3
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs
  18. 6
      src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs
  19. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

4
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

@ -154,7 +154,7 @@ namespace ICSharpCode.XmlEditor
} }
public override bool IsReadOnly { public override bool IsReadOnly {
get { get {
return xmlEditor.IsReadOnly; return xmlEditor.IsReadOnly;
} }
} }
@ -782,7 +782,7 @@ namespace ICSharpCode.XmlEditor
TextAreaControl activeTextAreaControl = xmlEditor.ActiveTextAreaControl; TextAreaControl activeTextAreaControl = xmlEditor.ActiveTextAreaControl;
int line = activeTextAreaControl.Caret.Line; int line = activeTextAreaControl.Caret.Line;
int col = activeTextAreaControl.Caret.Column; 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);
} }
/// <summary> /// <summary>

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -136,7 +136,7 @@
<Compile Include="Src\Services\AmbienceService\CodeDOMGeneratorUtility.cs" /> <Compile Include="Src\Services\AmbienceService\CodeDOMGeneratorUtility.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\WindowOpenEvaluator.cs" /> <Compile Include="Src\Internal\ConditionEvaluators\WindowOpenEvaluator.cs" />
<Compile Include="Src\Internal\Templates\Project\ProjectDescriptor.cs" /> <Compile Include="Src\Internal\Templates\Project\ProjectDescriptor.cs" />
<Compile Include="Src\Internal\Templates\Project\CombineDescriptor.cs" /> <Compile Include="Src\Internal\Templates\Project\SolutionDescriptor.cs" />
<Compile Include="Src\Gui\IProgressMonitor.cs" /> <Compile Include="Src\Gui\IProgressMonitor.cs" />
<Compile Include="Src\Gui\IViewContent.cs" /> <Compile Include="Src\Gui\IViewContent.cs" />
<Compile Include="Src\Gui\IWorkbench.cs" /> <Compile Include="Src\Gui\IWorkbench.cs" />

12
src/Main/Base/Project/Src/Commands/AutostartCommands.cs

@ -79,12 +79,12 @@ namespace ICSharpCode.SharpDevelop.Commands
{ {
//WorkbenchSingleton.MainForm.Show(); //WorkbenchSingleton.MainForm.Show();
bool didLoadCombineOrFile = false; bool didLoadSolutionOrFile = false;
NavigationService.SuspendLogging(); NavigationService.SuspendLogging();
foreach (string file in fileList) { foreach (string file in fileList) {
didLoadCombineOrFile = true; didLoadSolutionOrFile = true;
try { try {
IProjectLoader loader = ProjectService.GetProjectLoader(file); IProjectLoader loader = ProjectService.GetProjectLoader(file);
if (loader != null) { if (loader != null) {
@ -97,15 +97,15 @@ namespace ICSharpCode.SharpDevelop.Commands
} }
} }
// load previous combine // load previous solution
if (!didLoadCombineOrFile && PropertyService.Get("SharpDevelop.LoadPrevProjectOnStartup", false)) { if (!didLoadSolutionOrFile && PropertyService.Get("SharpDevelop.LoadPrevProjectOnStartup", false)) {
if (FileService.RecentOpen.RecentProject.Count > 0) { if (FileService.RecentOpen.RecentProject.Count > 0) {
ProjectService.LoadSolution(FileService.RecentOpen.RecentProject[0].ToString()); 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)) { foreach (ICommand command in AddInTree.BuildItems("/Workspace/AutostartNothingLoaded", null, false)) {
command.Run(); command.Run();
} }

27
src/Main/Base/Project/Src/Commands/CustomStringTagProvider.cs

@ -24,6 +24,7 @@ namespace ICSharpCode.SharpDevelop.Commands
"CurrentProjectName", "CurrentProjectName",
"ProjectDir", "ProjectFilename", "ProjectDir", "ProjectFilename",
"CombineDir", "CombineFilename", "CombineDir", "CombineFilename",
"SolutionDir", "SolutionFilename",
"Startuppath", "Startuppath",
"TaskService.Warnings", "TaskService.Errors", "TaskService.Messages", "TaskService.Warnings", "TaskService.Errors", "TaskService.Messages",
"NetSdkDir" "NetSdkDir"
@ -92,14 +93,28 @@ namespace ICSharpCode.SharpDevelop.Commands
} catch (Exception) {} } catch (Exception) {}
break; break;
// TODO:
case "CURLINE": case "CURLINE":
return String.Empty; {
IPositionable positionable = WorkbenchSingleton.Workbench.ActiveViewContent as IPositionable;
if (positionable != null)
return (positionable.Line + 1).ToString();
break;
}
case "CURCOL": case "CURCOL":
return String.Empty; {
IPositionable positionable = WorkbenchSingleton.Workbench.ActiveViewContent as IPositionable;
if (positionable != null)
return (positionable.Column + 1).ToString();
break;
}
case "CURTEXT": 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": case "TARGETPATH":
try { try {
return GetCurrentTargetPath(); return GetCurrentTargetPath();
@ -135,7 +150,9 @@ namespace ICSharpCode.SharpDevelop.Commands
break; break;
case "COMBINEDIR": case "COMBINEDIR":
case "SOLUTIONDIR":
return Path.GetDirectoryName(ProjectService.OpenSolution.FileName); return Path.GetDirectoryName(ProjectService.OpenSolution.FileName);
case "SOLUTIONFILENAME":
case "COMBINEFILENAME": case "COMBINEFILENAME":
try { try {
return Path.GetFileName(ProjectService.OpenSolution.FileName); return Path.GetFileName(ProjectService.OpenSolution.FileName);

27
src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs

@ -235,33 +235,6 @@ namespace ICSharpCode.SharpDevelop.Commands
if (item.Text == ToolLoader.Tool[i].ToString()) { if (item.Text == ToolLoader.Tool[i].ToString()) {
ExternalTool tool = (ExternalTool)ToolLoader.Tool[i]; 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 command = StringParser.Parse(tool.Command);
string args = StringParser.Parse(tool.Arguments); string args = StringParser.Parse(tool.Arguments);

8
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -258,7 +258,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
} }
public string NewProjectLocation; public string NewProjectLocation;
public string NewCombineLocation; public string NewSolutionLocation;
void OpenEvent(object sender, EventArgs e) void OpenEvent(object sender, EventArgs e)
{ {
@ -313,12 +313,12 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
cinfo.ProjectName = name; cinfo.ProjectName = name;
NewCombineLocation = item.Template.CreateProject(cinfo); NewSolutionLocation = item.Template.CreateProject(cinfo);
if (NewCombineLocation == null || NewCombineLocation.Length == 0) { if (NewSolutionLocation == null || NewSolutionLocation.Length == 0) {
return; return;
} }
if (createNewSolution) { if (createNewSolution) {
ProjectService.LoadSolutionOrProject(NewCombineLocation); ProjectService.LoadSolutionOrProject(NewSolutionLocation);
item.Template.RunOpenActions(cinfo); item.Template.RunOpenActions(cinfo);
} }

6
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.ProjectDirectory}", "${ProjectDir}"},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.ProjectFileName}", "${ProjectFileName}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.ProjectFileName}", "${ProjectFileName}"},
{"-", ""}, {"-", ""},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${CombineDir}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${SolutionDir}"},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineFileName}", "${CombineFileName}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineFileName}", "${SolutionFileName}"},
{"-", ""}, {"-", ""},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.SharpDevelopStartupPath}", "${StartupPath}"}, {"${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.ProjectDirectory}", "${ProjectDir}"},
{"-", ""}, {"-", ""},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${CombineDir}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.CombineDirectory}", "${SolutionDir}"},
{"-", ""}, {"-", ""},
{"${res:Dialog.Options.ExternalTool.QuickInsertMenu.SharpDevelopStartupPath}", "${StartupPath}"}, {"${res:Dialog.Options.ExternalTool.QuickInsertMenu.SharpDevelopStartupPath}", "${StartupPath}"},
}; };

6
src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs

@ -131,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.Gui
break; break;
} }
total = new Report(StringParser.Parse("${res:Dialog.WordCountDialog.TotalText}"), 0, 0, 0); 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(new ListViewItem(""));
// ((ListView)ControlDictionary["resultListView"]).Items.Add(all.ToListItem()); // ((ListView)ControlDictionary["resultListView"]).Items.Add(all.ToListItem());
break; break;
@ -140,9 +140,9 @@ namespace ICSharpCode.SharpDevelop.Gui
UpdateList(0); 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) { foreach (ProjectItem item in project.Items) {
if (item.ItemType == ItemType.Compile) { if (item.ItemType == ItemType.Compile) {
Report r = GetReport(item.FileName); Report r = GetReport(item.FileName);

8
src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs

@ -91,8 +91,8 @@ namespace ICSharpCode.SharpDevelop.Gui
}; };
ProjectService.EndBuild += ProjectServiceEndBuild; ProjectService.EndBuild += ProjectServiceEndBuild;
ProjectService.SolutionLoaded += OnCombineOpen; ProjectService.SolutionLoaded += OnSolutionOpen;
ProjectService.SolutionClosed += OnCombineClosed; ProjectService.SolutionClosed += OnSolutionClosed;
taskView.CreateControl(); taskView.CreateControl();
contentPanel.Controls.Add(taskView); contentPanel.Controls.Add(taskView);
@ -111,13 +111,13 @@ namespace ICSharpCode.SharpDevelop.Gui
taskView.RefreshColumnNames(); taskView.RefreshColumnNames();
} }
void OnCombineOpen(object sender, SolutionEventArgs e) void OnSolutionOpen(object sender, SolutionEventArgs e)
{ {
taskView.ClearTasks(); taskView.ClearTasks();
UpdateToolstripStatus(); UpdateToolstripStatus();
} }
void OnCombineClosed(object sender, EventArgs e) void OnSolutionClosed(object sender, EventArgs e)
{ {
try { try {
taskView.ClearTasks(); taskView.ClearTasks();

6
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(grid);
panel.Controls.Add(comboBox); panel.Controls.Add(comboBox);
ProjectService.SolutionClosed += CombineClosedEvent; ProjectService.SolutionClosed += SolutionClosedEvent;
grid.PropertyValueChanged += new PropertyValueChangedEventHandler(PropertyChanged); grid.PropertyValueChanged += new PropertyValueChangedEventHandler(PropertyChanged);
grid.ContextMenuStrip = MenuService.CreateContextMenu(this, "/SharpDevelop/Views/PropertyPad/ContextMenu"); grid.ContextMenuStrip = MenuService.CreateContextMenu(this, "/SharpDevelop/Views/PropertyPad/ContextMenu");
@ -197,7 +197,7 @@ namespace ICSharpCode.SharpDevelop.Gui
WorkbenchActiveContentChanged(null, null); WorkbenchActiveContentChanged(null, null);
} }
void CombineClosedEvent(object sender, EventArgs e) void SolutionClosedEvent(object sender, EventArgs e)
{ {
SetDesignableObjects(null); SetDesignableObjects(null);
} }
@ -300,7 +300,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{ {
base.Dispose(); base.Dispose();
if (grid != null) { if (grid != null) {
ProjectService.SolutionClosed -= CombineClosedEvent; ProjectService.SolutionClosed -= SolutionClosedEvent;
try { try {
grid.SelectedObjects = null; grid.SelectedObjects = null;
} catch {} } catch {}

8
src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs

@ -29,8 +29,8 @@ namespace ICSharpCode.SharpDevelop.Gui
TaskService.Added += new TaskEventHandler(TaskServiceAdded); TaskService.Added += new TaskEventHandler(TaskServiceAdded);
TaskService.Removed += new TaskEventHandler(TaskServiceRemoved); TaskService.Removed += new TaskEventHandler(TaskServiceRemoved);
ProjectService.SolutionLoaded += OnCombineOpen; ProjectService.SolutionLoaded += OnSolutionOpen;
ProjectService.SolutionClosed += OnCombineClosed; ProjectService.SolutionClosed += OnSolutionClosed;
InternalShowResults(null, null); InternalShowResults(null, null);
} }
@ -40,12 +40,12 @@ namespace ICSharpCode.SharpDevelop.Gui
taskView.RefreshColumnNames(); taskView.RefreshColumnNames();
} }
void OnCombineOpen(object sender, SolutionEventArgs e) void OnSolutionOpen(object sender, SolutionEventArgs e)
{ {
taskView.ClearTasks(); taskView.ClearTasks();
} }
void OnCombineClosed(object sender, EventArgs e) void OnSolutionClosed(object sender, EventArgs e)
{ {
taskView.ClearTasks(); taskView.ClearTasks();
} }

6
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs

@ -22,7 +22,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public class ProjectCreateInformation public class ProjectCreateInformation
{ {
string projectName; string projectName;
string combinePath; string solutionPath;
string projectBasePath; string projectBasePath;
string outputProjectFileName; string outputProjectFileName;
string rootNamespace; string rootNamespace;
@ -59,10 +59,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public string SolutionPath { public string SolutionPath {
get { get {
return combinePath; return solutionPath;
} }
set { set {
combinePath = value; solutionPath = value;
} }
} }

2
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -20,7 +20,7 @@ using MSBuild = Microsoft.Build.BuildEngine;
namespace ICSharpCode.SharpDevelop.Internal.Templates namespace ICSharpCode.SharpDevelop.Internal.Templates
{ {
/// <summary> /// <summary>
/// This class is used inside the combine templates for projects. /// This class is used inside the solution templates for projects.
/// </summary> /// </summary>
public sealed class ProjectDescriptor public sealed class ProjectDescriptor
{ {

18
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
ArrayList actions = new ArrayList(); ArrayList actions = new ArrayList();
CombineDescriptor combineDescriptor = null; SolutionDescriptor solutionDescriptor = null;
ProjectDescriptor projectDescriptor = null; ProjectDescriptor projectDescriptor = null;
#region Template Properties #region Template Properties
@ -159,9 +159,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
[Browsable(false)] [Browsable(false)]
public CombineDescriptor CombineDescriptor { public SolutionDescriptor SolutionDescriptor {
get { get {
return combineDescriptor; return solutionDescriptor;
} }
} }
@ -221,9 +221,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string hintPath = Path.GetDirectoryName(xmlFileName); string hintPath = Path.GetDirectoryName(xmlFileName);
if (templateElement["Solution"] != null) { if (templateElement["Solution"] != null) {
combineDescriptor = CombineDescriptor.CreateCombineDescriptor(templateElement["Solution"], hintPath); solutionDescriptor = SolutionDescriptor.CreateSolutionDescriptor(templateElement["Solution"], hintPath);
} else if (templateElement["Combine"] != null) { } else if (templateElement["Combine"] != null) {
combineDescriptor = CombineDescriptor.CreateCombineDescriptor(templateElement["Combine"], hintPath); solutionDescriptor = SolutionDescriptor.CreateSolutionDescriptor(templateElement["Combine"], hintPath);
WarnObsoleteNode(templateElement["Combine"], "Use <Solution> instead!"); WarnObsoleteNode(templateElement["Combine"], "Use <Solution> instead!");
} }
@ -231,8 +231,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
projectDescriptor = new ProjectDescriptor(templateElement["Project"], hintPath); projectDescriptor = new ProjectDescriptor(templateElement["Project"], hintPath);
} }
if (combineDescriptor == null && projectDescriptor == null if (solutionDescriptor == null && projectDescriptor == null
|| combineDescriptor != null && projectDescriptor != null) || solutionDescriptor != null && projectDescriptor != null)
{ {
throw new TemplateLoadException("Template must contain either Project or Solution node!"); throw new TemplateLoadException("Template must contain either Project or Solution node!");
} }
@ -281,8 +281,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
return null; return null;
} }
} }
if (combineDescriptor != null) { if (solutionDescriptor != null) {
return combineDescriptor.CreateSolution(projectCreateInformation, this.languagename); return solutionDescriptor.CreateSolution(projectCreateInformation, this.languagename);
} else if (projectDescriptor != null) { } else if (projectDescriptor != null) {
projectCreateInformation.Solution = new Solution(); projectCreateInformation.Solution = new Solution();
IProject project = projectDescriptor.CreateProject(projectCreateInformation, this.languagename); IProject project = projectDescriptor.CreateProject(projectCreateInformation, this.languagename);

34
src/Main/Base/Project/Src/Internal/Templates/Project/CombineDescriptor.cs → src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs

@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Internal.Templates namespace ICSharpCode.SharpDevelop.Internal.Templates
{ {
public class CombineDescriptor public class SolutionDescriptor
{ {
SolutionFolderDescriptor mainFolder = new SolutionFolderDescriptor(""); SolutionFolderDescriptor mainFolder = new SolutionFolderDescriptor("");
@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} }
#endregion #endregion
protected CombineDescriptor(string name) protected SolutionDescriptor(string name)
{ {
this.name = name; this.name = name;
} }
@ -97,11 +97,11 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
Solution newSolution = new Solution(); Solution newSolution = new Solution();
projectCreateInformation.Solution = newSolution; projectCreateInformation.Solution = newSolution;
string newCombineName = StringParser.Parse(name, new string[,] { string newSolutionName = StringParser.Parse(name, new string[,] {
{"ProjectName", projectCreateInformation.ProjectName} {"ProjectName", projectCreateInformation.ProjectName}
}); });
newSolution.Name = newCombineName; newSolution.Name = newSolutionName;
string oldCombinePath = projectCreateInformation.SolutionPath; string oldCombinePath = projectCreateInformation.SolutionPath;
string oldProjectPath = projectCreateInformation.ProjectBasePath; string oldProjectPath = projectCreateInformation.ProjectBasePath;
@ -124,35 +124,35 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
return null; return null;
} }
string combineLocation = Path.Combine(projectCreateInformation.SolutionPath, newCombineName + ".sln"); string solutionLocation = Path.Combine(projectCreateInformation.SolutionPath, newSolutionName + ".sln");
// Save combine // Save solution
if (File.Exists(combineLocation)) { if (File.Exists(solutionLocation)) {
StringParser.Properties["combineLocation"] = combineLocation; StringParser.Properties["combineLocation"] = solutionLocation;
if (MessageService.AskQuestion("${res:ICSharpCode.SharpDevelop.Internal.Templates.CombineDescriptor.OverwriteProjectQuestion}")) { if (MessageService.AskQuestion("${res:ICSharpCode.SharpDevelop.Internal.Templates.CombineDescriptor.OverwriteProjectQuestion}")) {
newSolution.Save(combineLocation); newSolution.Save(solutionLocation);
} }
} else { } else {
newSolution.Save(combineLocation); newSolution.Save(solutionLocation);
} }
newSolution.Dispose(); 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) { 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) { 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); solutionDescriptor.mainFolder.Read(element, hintPath);
return combineDescriptor; return solutionDescriptor;
} }
} }
} }

2
src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop
public static class ClassBrowserIconService public static class ClassBrowserIconService
{ {
public const int NamespaceIndex = 3; public const int NamespaceIndex = 3;
public const int CombineIndex = 14; public const int SolutionIndex = 14;
public const int ConstIndex = 15; public const int ConstIndex = 15;
public const int GotoArrowIndex = 13; public const int GotoArrowIndex = 13;

3
src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop
{ {
if (loadSolutionProjectsThread != null) { if (loadSolutionProjectsThread != null) {
if (!abortLoadSolutionProjectsThread) 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)) { if (!loadSolutionProjectsThread.Join(50)) {
// loadSolutionProjects might be waiting for main thread, so give it // loadSolutionProjects might be waiting for main thread, so give it
// a chance to complete safethread calls by putting this method at // a chance to complete safethread calls by putting this method at
@ -412,6 +412,7 @@ namespace ICSharpCode.SharpDevelop
} }
IEditable editable = activeViewContent as IEditable; IEditable editable = activeViewContent as IEditable;
if (editable != null) { 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 fileName = activeViewContent.PrimaryFileName;
string text = null; string text = null;

6
src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs

@ -47,9 +47,9 @@ namespace ICSharpCode.SharpDevelop
statusBar.CursorStatusBarPanel.Text = StringParser.Parse( statusBar.CursorStatusBarPanel.Text = StringParser.Parse(
"${res:StatusBarService.CursorStatusBarPanelText}", "${res:StatusBarService.CursorStatusBarPanelText}",
new string[,] { new string[,] {
{"Line", String.Format("{0,-10}", y + 1)}, {"Line", String.Format("{0,-10}", y)},
{"Column", String.Format("{0,-5}", x + 1)}, {"Column", String.Format("{0,-5}", x)},
{"Character", String.Format("{0,-5}", charOffset + 1)} {"Character", String.Format("{0,-5}", charOffset)}
}); });
} }

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -288,7 +288,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
TextAreaControl activeTextAreaControl = textEditorControl.ActiveTextAreaControl; TextAreaControl activeTextAreaControl = textEditorControl.ActiveTextAreaControl;
int line = activeTextAreaControl.Caret.Line; int line = activeTextAreaControl.Caret.Line;
int col = activeTextAreaControl.Caret.Column; 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()); NavigationService.Log(this.BuildNavPoint());
} }

Loading…
Cancel
Save