Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:icsharpcode/SharpDevelop
Browse files Browse the repository at this point in the history
  • Loading branch information
mrward committed Jan 29, 2012
2 parents fe0b8d7 + a06323c commit 917f7ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

using ICSharpCode.Core;
Expand Down Expand Up @@ -185,6 +186,7 @@ bool IsInScope(Task item)

switch (this.selectedScopeIndex) {
case 0:
// Solution
if (ProjectService.OpenSolution != null) {
foreach (AbstractProject proj in ProjectService.OpenSolution.Projects) {
if (proj.FindFile(item.FileName) != null)
Expand All @@ -193,12 +195,19 @@ bool IsInScope(Task item)
}
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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 917f7ce

Please sign in to comment.