Browse Source

add option to shcw tasks from all open files

pull/18/head
Siegfried Pammer 14 years ago
parent
commit
a06323c7a0
  1. 13
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
  2. 2
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs

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

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ICSharpCode.Core;
@ -185,6 +186,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -185,6 +186,7 @@ namespace ICSharpCode.SharpDevelop.Gui
switch (this.selectedScopeIndex) {
case 0:
// Solution
if (ProjectService.OpenSolution != null) {
foreach (AbstractProject proj in ProjectService.OpenSolution.Projects) {
if (proj.FindFile(item.FileName) != null)
@ -193,12 +195,19 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -193,12 +195,19 @@ namespace ICSharpCode.SharpDevelop.Gui
}
return false;
case 1:
// Project
return ProjectService.CurrentProject != null && ProjectService.CurrentProject.FindFile(item.FileName) != null;
case 2:
return WorkbenchSingleton.Workbench.ActiveViewContent != null && WorkbenchSingleton.Workbench.ActiveViewContent.PrimaryFileName == FileName.Create(item.FileName);
// All open documents
return WorkbenchSingleton.Workbench.ViewContentCollection.OfType<ITextEditorProvider>().Any(provider => item.FileName == provider.TextEditor.FileName);
case 3:
return current != null && itemClass != null && current.Namespace == itemClass.Namespace;
// Document
return WorkbenchSingleton.Workbench.ActiveViewContent != null && WorkbenchSingleton.Workbench.ActiveViewContent.PrimaryFileName == FileName.Create(item.FileName);
case 4:
// Namespace
return current != null && itemClass != null && current.Namespace == itemClass.Namespace;
case 5:
// Class/Module
return current != null && itemClass != null && current == itemClass;
}

2
src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs

@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public class SelectScopeCommand : AbstractComboBoxCommand
{
private ComboBox comboBox;
private static string[] viewTypes = new string[] {"Solution", "Project", "Document", "Namespace", "Class/Module"};
private static string[] viewTypes = new string[] {"Solution", "Project", "All open documents", "Document", "Namespace", "Class/Module"};
protected override void OnOwnerChanged(EventArgs e)
{

Loading…
Cancel
Save