From 2e04f295a23db85317ffc23c0295e2922c2fd6dd Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 27 Apr 2016 15:49:20 +0900 Subject: [PATCH] working on #553 - Select All menu item --- ILSpy/TextView/EditorCommands.cs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/ILSpy/TextView/EditorCommands.cs b/ILSpy/TextView/EditorCommands.cs index 8615ee896..2907453d2 100644 --- a/ILSpy/TextView/EditorCommands.cs +++ b/ILSpy/TextView/EditorCommands.cs @@ -16,15 +16,10 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - namespace ICSharpCode.ILSpy.TextView { - [ExportContextMenuEntryAttribute(Header = "Copy", Category = "Editor")] - internal sealed class CopyContextMenuEntry : IContextMenuEntry + [ExportContextMenuEntry(Header = "Copy", Category = "Editor")] + sealed class CopyContextMenuEntry : IContextMenuEntry { public bool IsVisible(TextViewContext context) { @@ -41,4 +36,23 @@ namespace ICSharpCode.ILSpy.TextView context.TextView.textEditor.Copy(); } } + + [ExportContextMenuEntry(Header = "Select All", Category = "Editor")] + sealed class SelectAllContextMenuEntry : IContextMenuEntry + { + public bool IsVisible(TextViewContext context) + { + return context.TextView != null; + } + + public bool IsEnabled(TextViewContext context) + { + return context.TextView != null; + } + + public void Execute(TextViewContext context) + { + context.TextView.textEditor.SelectAll(); + } + } }