private void BuildCommands() { CommandMapper.Add( NiResources.TextEditor_Copy, e => new Copy().Execute(ActiveTextAreaControl.TextArea), e => e.Status = ActiveTextAreaControl.SelectionManager.HasSomethingSelected ? NiCommandStatus.Enabled : 0 ); CommandMapper.Add( NiResources.TextEditor_Cut, e => new Cut().Execute(ActiveTextAreaControl.TextArea), e => e.Status = !Document.ReadOnly && ActiveTextAreaControl.SelectionManager.HasSomethingSelected ? NiCommandStatus.Enabled : 0 ); CommandMapper.Add( NiResources.TextEditor_Paste, e => new Paste().Execute(ActiveTextAreaControl.TextArea), e => e.Status = !Document.ReadOnly ? NiCommandStatus.Enabled : 0 ); CommandMapper.Add( NiResources.TextEditor_Undo, e => new Undo().Execute(ActiveTextAreaControl.TextArea), e => e.Status = !Document.ReadOnly && Document.UndoStack.CanUndo ? NiCommandStatus.Enabled : 0 ); CommandMapper.Add( NiResources.TextEditor_Redo, e => new Redo().Execute(ActiveTextAreaControl.TextArea), e => e.Status = !Document.ReadOnly && Document.UndoStack.CanRedo ? NiCommandStatus.Enabled : 0 ); CommandMapper.Add( NiResources.TextEditor_GoToLine, e => GoToLine() ); CommandMapper.Add( NiResources.TextEditor_Find, e => OpenFindWindow(NiFindOptions.Find) ); CommandMapper.Add( NiResources.TextEditor_FindAndReplace, e => OpenFindWindow(NiFindOptions.Replace), e => e.Status = !Document.ReadOnly ? NiCommandStatus.Enabled : 0 ); }