Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6412 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
23 changed files with 422 additions and 82 deletions
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Martin Konicek" email="martin.konicek@gmail.com"/>
|
||||
// <version>$Revision: $</version>
|
||||
// </file>
|
||||
using System; |
||||
using System.Collections.ObjectModel; |
||||
using System.Linq; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Refactoring |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ContextActionsHiddenViewModel.
|
||||
/// </summary>
|
||||
public class ContextActionsHiddenViewModel : ContextActionsViewModel |
||||
{ |
||||
public EditorActionsProvider Model { get; private set; } |
||||
|
||||
public ObservableCollection<ContextActionViewModel> HiddenActions { get; set; } |
||||
|
||||
public ContextActionsHiddenViewModel(EditorActionsProvider model) |
||||
{ |
||||
this.Model = model; |
||||
this.Actions = new ObservableCollection<ContextActionViewModel>( |
||||
model.GetVisibleActions().Select(a => new ContextActionViewModel(a) { IsVisible = true } )); |
||||
this.HiddenActions = new ObservableCollection<ContextActionViewModel>(); |
||||
} |
||||
|
||||
bool hiddenActionsLoaded = false; |
||||
|
||||
public void LoadHiddenActions() |
||||
{ |
||||
if (hiddenActionsLoaded) |
||||
return; |
||||
|
||||
this.HiddenActions.AddRange( |
||||
Model.GetHiddenActions().Select(a => new ContextActionViewModel(a) { IsVisible = false } )); |
||||
hiddenActionsLoaded = true; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Martin Konicek" email="martin.konicek@gmail.com"/>
|
||||
// <version>$Revision: $</version>
|
||||
// </file>
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Refactoring; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Refactoring |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ContextActionsProvider.
|
||||
/// </summary>
|
||||
public abstract class ContextActionsProvider : IContextActionsProvider |
||||
{ |
||||
public bool IsVisible { get; set; } |
||||
|
||||
public abstract IEnumerable<IContextAction> GetAvailableActions(EditorContext context); |
||||
} |
||||
} |
Loading…
Reference in new issue