Browse Source

Fixed duplicate items in output pad due to race condition in CompilerMessageView. Addins that use the output pad changed to bring pad to front before adding messages to it. Added NAnt build file filter when opening files.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@670 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 21 years ago
parent
commit
fce237bd28
  1. 41
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
  2. 42
      src/AddIns/DisplayBindings/XmlEditor/XmlEditor.sln
  3. 2
      src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitPad.cs
  4. 7
      src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs
  5. 46
      src/AddIns/Misc/NAntAddIn/NAntAddIn.sln
  6. 14
      src/AddIns/Misc/NAntAddIn/Project/NAnt.addin
  7. 13
      src/AddIns/Misc/NAntAddIn/Project/Src/Commands/AbstractRunNAntCommand.cs
  8. 38
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

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

@ -34,6 +34,11 @@ namespace ICSharpCode.XmlEditor
/// </summary> /// </summary>
public static readonly string Language = "XML"; public static readonly string Language = "XML";
/// <summary>
/// Output window category name.
/// </summary>
public static readonly string CategoryName = "XML";
delegate void RefreshDelegate(AbstractMargin margin); delegate void RefreshDelegate(AbstractMargin margin);
XmlEditorControl xmlEditor = new XmlEditorControl(); XmlEditorControl xmlEditor = new XmlEditorControl();
@ -59,6 +64,12 @@ namespace ICSharpCode.XmlEditor
XmlSchemaManager.UserSchemaRemoved += new EventHandler(UserSchemaRemoved); XmlSchemaManager.UserSchemaRemoved += new EventHandler(UserSchemaRemoved);
} }
public override string TabPageText {
get {
return "XML";
}
}
/// <summary> /// <summary>
/// Loads the string content into the view. /// Loads the string content into the view.
/// </summary> /// </summary>
@ -105,6 +116,8 @@ namespace ICSharpCode.XmlEditor
{ {
TaskService.ClearExceptCommentTasks(); TaskService.ClearExceptCommentTasks();
Category.ClearText(); Category.ClearText();
ShowOutputWindow();
OutputWindowWriteLine(StringParser.Parse("${res:MainWindow.XmlValidationMessages.ValidationStarted}")); OutputWindowWriteLine(StringParser.Parse("${res:MainWindow.XmlValidationMessages.ValidationStarted}"));
try { try {
@ -124,6 +137,8 @@ namespace ICSharpCode.XmlEditor
} }
} catch (XmlSchemaException ex) { } catch (XmlSchemaException ex) {
DisplayValidationError(schemaData.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1); DisplayValidationError(schemaData.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1);
ShowErrorList();
return;
} }
XmlReader reader = XmlReader.Create(xmlReader, settings); XmlReader reader = XmlReader.Create(xmlReader, settings);
@ -140,10 +155,7 @@ namespace ICSharpCode.XmlEditor
DisplayValidationError(xmlEditor.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1); DisplayValidationError(xmlEditor.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1);
} }
// Show errors. ShowErrorList();
if (ShowErrorListAfterBuild) {
ShowErrorList();
}
} }
/// <summary> /// <summary>
@ -209,6 +221,8 @@ namespace ICSharpCode.XmlEditor
public void RunXslTransform(string xsl) public void RunXslTransform(string xsl)
{ {
try { try {
WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront();
TaskService.ClearExceptCommentTasks(); TaskService.ClearExceptCommentTasks();
if (IsWellFormed) { if (IsWellFormed) {
@ -218,9 +232,7 @@ namespace ICSharpCode.XmlEditor
} }
} }
if (ShowErrorListAfterBuild) { ShowErrorList();
ShowErrorList();
}
} catch (Exception ex) { } catch (Exception ex) {
MessageService.ShowError(ex); MessageService.ShowError(ex);
@ -601,7 +613,7 @@ namespace ICSharpCode.XmlEditor
MessageViewCategory Category { MessageViewCategory Category {
get { get {
if (category == null) { if (category == null) {
category = new MessageViewCategory("Xml", "Xml"); category = new MessageViewCategory(CategoryName);
CompilerMessageView cmv = (CompilerMessageView)WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).PadContent; CompilerMessageView cmv = (CompilerMessageView)WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).PadContent;
cmv.AddCategory(category); cmv.AddCategory(category);
} }
@ -610,6 +622,14 @@ namespace ICSharpCode.XmlEditor
} }
} }
/// <summary>
/// Brings output window pad to the front.
/// </summary>
void ShowOutputWindow()
{
WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront();
}
/// <summary> /// <summary>
/// Writes a line of text to the output window. /// Writes a line of text to the output window.
/// </summary> /// </summary>
@ -617,6 +637,7 @@ namespace ICSharpCode.XmlEditor
/// window.</param> /// window.</param>
void OutputWindowWriteLine(string message) void OutputWindowWriteLine(string message)
{ {
LoggingService.Info("WriteLine message=" + message);
Category.AppendText(String.Concat(message, Environment.NewLine)); Category.AppendText(String.Concat(message, Environment.NewLine));
} }
@ -628,7 +649,7 @@ namespace ICSharpCode.XmlEditor
void ShowErrorList() void ShowErrorList()
{ {
if (TaskService.SomethingWentWrong) { if (ShowErrorListAfterBuild && TaskService.SomethingWentWrong) {
WorkbenchSingleton.Workbench.GetPad(typeof(ErrorList)).BringPadToFront(); WorkbenchSingleton.Workbench.GetPad(typeof(ErrorList)).BringPadToFront();
} }
} }
@ -811,6 +832,8 @@ namespace ICSharpCode.XmlEditor
{ {
try try
{ {
WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront();
StringReader reader = new StringReader(xml); StringReader reader = new StringReader(xml);
XPathDocument doc = new XPathDocument(reader); XPathDocument doc = new XPathDocument(reader);

42
src/AddIns/DisplayBindings/XmlEditor/XmlEditor.sln

@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.612 # SharpDevelop 2.0.0.646
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{63B6CA43-58D0-4BF0-9D4F-1ABE4009E488}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor.Tests", "Test\XmlEditor.Tests.csproj", "{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor.Tests", "Test\XmlEditor.Tests.csproj", "{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}"
EndProject EndProject
@ -10,5 +10,43 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\.
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}.Release|Any CPU.Build.0 = Release|Any CPU
{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}.Release|Any CPU.Build.0 = Release|Any CPU
{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal EndGlobal

2
src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitPad.cs

@ -206,7 +206,7 @@ namespace ICSharpCode.MbUnitPad
void ShowErrorList() void ShowErrorList()
{ {
if (TaskService.TaskCount > 0) { if (TaskService.SomethingWentWrong) {
WorkbenchSingleton.Workbench.GetPad(typeof(ErrorList)).BringPadToFront(); WorkbenchSingleton.Workbench.GetPad(typeof(ErrorList)).BringPadToFront();
} }
} }

7
src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs

@ -160,13 +160,16 @@ namespace ICSharpCode.MbUnitPad
void OnTestsStartedInvoked(object sender, EventArgs e) void OnTestsStartedInvoked(object sender, EventArgs e)
{ {
PadDescriptor outputPad = WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView));
if (testRunnerCategory == null) { if (testRunnerCategory == null) {
testRunnerCategory = new MessageViewCategory("MbUnit"); testRunnerCategory = new MessageViewCategory("MbUnit");
CompilerMessageView cmv = (CompilerMessageView)WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).PadContent; ((CompilerMessageView)outputPad.PadContent).AddCategory(testRunnerCategory);
cmv.AddCategory(testRunnerCategory);
} else { } else {
testRunnerCategory.ClearText(); testRunnerCategory.ClearText();
} }
outputPad.BringPadToFront();
} }
void OnFacadeUpdated(ResultEventArgs e) void OnFacadeUpdated(ResultEventArgs e)

46
src/AddIns/Misc/NAntAddIn/NAntAddIn.sln

@ -1,8 +1,52 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.558 # SharpDevelop 2.0.0.646
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAntAddIn", "Project\NAntAddIn.csproj", "{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAntAddIn", "Project\NAntAddIn.csproj", "{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAntAddIn.Tests", "Test\NAntAddIn.Tests.csproj", "{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAntAddIn.Tests", "Test\NAntAddIn.Tests.csproj", "{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}.Release|Any CPU.Build.0 = Release|Any CPU
{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}.Release|Any CPU.Build.0 = Release|Any CPU
{1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal EndGlobal

14
src/AddIns/Misc/NAntAddIn/Project/NAnt.addin

@ -11,10 +11,18 @@
</Import> </Import>
</Runtime> </Runtime>
<!-- NAnt file filter -->
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "NAnt"
insertbefore="AllFiles"
name = "NAnt Build Files (*.build;*.include)"
extensions = "*.build;*.include"/>
</Path>
<!-- Menu options --> <!-- Menu options -->
<Path name = "/SharpDevelop/Workbench/MainMenu/Project"> <Path name = "/SharpDevelop/Workbench/MainMenu/Project">
<MenuItem id = "NAnt" <MenuItem id = "NAnt"
label = "NAnt" label = "&amp;NAnt"
insertbefore = "Separator2" insertbefore = "Separator2"
type="Menu"> type="Menu">
<ComplexCondition action="Disable"> <ComplexCondition action="Disable">
@ -57,7 +65,7 @@
<!-- Context menu options --> <!-- Context menu options -->
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectNode"> <Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectNode">
<MenuItem id = "NAnt" <MenuItem id = "NAnt"
label = "NAnt" label = "&amp;NAnt"
insertafter = "Properties" insertafter = "Properties"
type="Menu"> type="Menu">
<ComplexCondition action="Disable"> <ComplexCondition action="Disable">
@ -110,7 +118,7 @@
<!-- Options panel --> <!-- Options panel -->
<Path name = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions"> <Path name = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<DialogPanel id = "NAntAddInOptionPanel" <DialogPanel id = "NAntAddInOptionPanel"
label = "NAnt" label = "&amp;NAnt"
class = "ICSharpCode.NAntAddIn.Gui.NAntAddInOptionPanel"/> class = "ICSharpCode.NAntAddIn.Gui.NAntAddInOptionPanel"/>
</Path> </Path>

13
src/AddIns/Misc/NAntAddIn/Project/Src/Commands/AbstractRunNAntCommand.cs

@ -119,7 +119,7 @@ namespace ICSharpCode.NAntAddIn.Commands
protected void RunPreBuildSteps() protected void RunPreBuildSteps()
{ {
//ProjectService.DoBeforeCompileAction(); //ProjectService.DoBeforeCompileAction();
TaskService.Clear(); TaskService.ClearExceptCommentTasks();
} }
/// <summary> /// <summary>
@ -153,6 +153,7 @@ namespace ICSharpCode.NAntAddIn.Commands
} }
Category.ClearText(); Category.ClearText();
ShowOutputPad();
runner.BuildFileName = buildFileName; runner.BuildFileName = buildFileName;
runner.NAntFileName = AddInOptions.NAntFileName; runner.NAntFileName = AddInOptions.NAntFileName;
@ -217,7 +218,7 @@ namespace ICSharpCode.NAntAddIn.Commands
MessageViewCategory Category { MessageViewCategory Category {
get { get {
if (category == null) { if (category == null) {
category = new MessageViewCategory("NAnt", "NAnt"); category = new MessageViewCategory("NAnt");
CompilerMessageView cmv = (CompilerMessageView)WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).PadContent; CompilerMessageView cmv = (CompilerMessageView)WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).PadContent;
cmv.AddCategory(category); cmv.AddCategory(category);
} }
@ -235,6 +236,14 @@ namespace ICSharpCode.NAntAddIn.Commands
Category.AppendText(String.Concat(message, Environment.NewLine)); Category.AppendText(String.Concat(message, Environment.NewLine));
} }
/// <summary>
/// Brings output pad to the front.
/// </summary>
void ShowOutputPad()
{
WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront();
}
/// <summary> /// <summary>
/// Looks for the first file that matches the specified /// Looks for the first file that matches the specified
/// file extension. /// file extension.

38
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -50,7 +50,9 @@ namespace ICSharpCode.SharpDevelop.Gui
set { set {
if (selectedCategory != value) { if (selectedCategory != value) {
selectedCategory = value; selectedCategory = value;
LoggingService.Debug("SelectedCategoryIndex. text before=" + textEditorControl.Text);
textEditorControl.Text = (value < 0) ? "" : messageCategories[value].Text; textEditorControl.Text = (value < 0) ? "" : messageCategories[value].Text;
LoggingService.Debug("SelectedCategoryIndex. text after=" + textEditorControl.Text);
textEditorControl.Refresh(); textEditorControl.Refresh();
OnSelectedCategoryIndexChanged(EventArgs.Empty); OnSelectedCategoryIndexChanged(EventArgs.Empty);
} }
@ -166,31 +168,39 @@ namespace ICSharpCode.SharpDevelop.Gui
void ClearText(MessageViewCategory category) void ClearText(MessageViewCategory category)
{ {
if (messageCategories[SelectedCategoryIndex] == category) { if (messageCategories[SelectedCategoryIndex] == category) {
textEditorControl.Text = ""; textEditorControl.Text = String.Empty;
textEditorControl.Refresh(); textEditorControl.Refresh();
} }
} }
void CategoryTextSet(object sender, TextEventArgs e) void CategoryTextSet(object sender, TextEventArgs e)
{ {
LoggingService.Warn("CategoryTextSet event");
WorkbenchSingleton.SafeThreadAsyncCall(this, "SetText", (MessageViewCategory)sender, e.Text); WorkbenchSingleton.SafeThreadAsyncCall(this, "SetText", (MessageViewCategory)sender, e.Text);
} }
void CategoryTextAppended(object sender, TextEventArgs e) void CategoryTextAppended(object sender, TextEventArgs e)
{ {
WorkbenchSingleton.SafeThreadAsyncCall(this, "AppendText", (MessageViewCategory)sender, e.Text); LoggingService.Warn("CategoryTextAppended event");
WorkbenchSingleton.SafeThreadAsyncCall(this, "AppendText", (MessageViewCategory)sender, ((MessageViewCategory)sender).Text, e.Text);
} }
void AppendText(MessageViewCategory category, string text) void AppendText(MessageViewCategory category, string fullText, string text)
{ {
LoggingService.Debug("AppendText");
if (messageCategories[SelectedCategoryIndex] != category) { if (messageCategories[SelectedCategoryIndex] != category) {
SelectCategory(category.Category); LoggingService.Debug("AppendText Selecting category. fulltext=" + fullText);
SelectCategory(category.Category, fullText);
return; return;
} }
if (text != null) { if (text != null) {
text = StringParser.Parse(text); text = StringParser.Parse(text);
LoggingService.Debug("cmv.AppendText.text=" + text);
textEditorControl.Document.ReadOnly = false; textEditorControl.Document.ReadOnly = false;
LoggingService.Debug("cmv.AppendText Doc before insert=" + textEditorControl.Document.TextContent);
textEditorControl.Document.Insert(textEditorControl.Document.TextLength, text); textEditorControl.Document.Insert(textEditorControl.Document.TextLength, text);
LoggingService.Debug("cmv.AppendText Doc after insert=" + textEditorControl.Document.TextContent);
textEditorControl.Document.ReadOnly = true; textEditorControl.Document.ReadOnly = true;
textEditorControl.ActiveTextAreaControl.Caret.Position = new Point(0, textEditorControl.Document.TotalNumberOfLines); textEditorControl.ActiveTextAreaControl.Caret.Position = new Point(0, textEditorControl.Document.TotalNumberOfLines);
textEditorControl.ActiveTextAreaControl.ScrollTo(textEditorControl.Document.TotalNumberOfLines); textEditorControl.ActiveTextAreaControl.ScrollTo(textEditorControl.Document.TotalNumberOfLines);
@ -208,7 +218,10 @@ namespace ICSharpCode.SharpDevelop.Gui
} else { } else {
text = StringParser.Parse(text); text = StringParser.Parse(text);
} }
LoggingService.Debug("cmv.SetText text=" + text);
LoggingService.Debug("cmv.SetText editor.text before insert=" + textEditorControl.Text);
textEditorControl.Text = text; textEditorControl.Text = text;
LoggingService.Debug("cmv.SetText editor.text after insert=" + textEditorControl.Text);
textEditorControl.Refresh(); textEditorControl.Refresh();
} }
@ -226,6 +239,22 @@ namespace ICSharpCode.SharpDevelop.Gui
} }
} }
void SelectCategory(string categoryName, string text)
{
for (int i = 0; i < messageCategories.Count; ++i) {
MessageViewCategory category = (MessageViewCategory)messageCategories[i];
if (category.Category == categoryName) {
selectedCategory = i;
LoggingService.Debug("SelectedCategory. text before=" + textEditorControl.Text);
textEditorControl.Text = text;
LoggingService.Debug("SelectedCategory. text after=" + textEditorControl.Text);
textEditorControl.Refresh();
OnSelectedCategoryIndexChanged(EventArgs.Empty);
break;
}
}
}
public MessageViewCategory GetCategory(string categoryName) public MessageViewCategory GetCategory(string categoryName)
{ {
foreach (MessageViewCategory category in messageCategories) { foreach (MessageViewCategory category in messageCategories) {
@ -244,6 +273,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// </summary> /// </summary>
void ActivateThisPad() void ActivateThisPad()
{ {
LoggingService.Debug("ActivateThisPad");
WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this.GetType().FullName); WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this.GetType().FullName);
} }

Loading…
Cancel
Save