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 20 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

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

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

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.612
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{63B6CA43-58D0-4BF0-9D4F-1ABE4009E488}"
# SharpDevelop 2.0.0.646
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{6B717BD1-CD5E-498C-A42E-9E6A4584DC48}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor.Tests", "Test\XmlEditor.Tests.csproj", "{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}"
EndProject
@ -10,5 +10,43 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\. @@ -10,5 +10,43 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
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
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

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

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

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

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

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

@ -1,8 +1,52 @@ @@ -1,8 +1,52 @@
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}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAntAddIn.Tests", "Test\NAntAddIn.Tests.csproj", "{13AB8351-39E5-4F9D-A59C-B30D60CF6B8C}"
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
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

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

@ -11,10 +11,18 @@ @@ -11,10 +11,18 @@
</Import>
</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 -->
<Path name = "/SharpDevelop/Workbench/MainMenu/Project">
<MenuItem id = "NAnt"
label = "NAnt"
label = "&amp;NAnt"
insertbefore = "Separator2"
type="Menu">
<ComplexCondition action="Disable">
@ -57,7 +65,7 @@ @@ -57,7 +65,7 @@
<!-- Context menu options -->
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectNode">
<MenuItem id = "NAnt"
label = "NAnt"
label = "&amp;NAnt"
insertafter = "Properties"
type="Menu">
<ComplexCondition action="Disable">
@ -110,7 +118,7 @@ @@ -110,7 +118,7 @@
<!-- Options panel -->
<Path name = "/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<DialogPanel id = "NAntAddInOptionPanel"
label = "NAnt"
label = "&amp;NAnt"
class = "ICSharpCode.NAntAddIn.Gui.NAntAddInOptionPanel"/>
</Path>

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

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

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

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

Loading…
Cancel
Save