| 1: | // SelectionKeys.cs | |
| 2: | // Copyright (C) 2001 Mike Krueger | |
| 3: | // | |
| 4: | // This program is free software; you can redistribute it and/or modify | |
| 5: | // it under the terms of the GNU General Public License as published by | |
| 6: | // the Free Software Foundation; either version 2 of the License, or | |
| 7: | // (at your option) any later version. | |
| 8: | // | |
| 9: | // This program is distributed in the hope that it will be useful, | |
| 10: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 12: | // GNU General Public License for more details. | |
| 13: | // | |
| 14: | // You should have received a copy of the GNU General Public License | |
| 15: | // along with this program; if not, write to the Free Software | |
| 16: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 17: | ||
| 18: | using System.Drawing; | |
| 19: | using System.Windows.Forms; | |
| 20: | using System; | |
| 21: | ||
| 22: | using SharpDevelop.DefaultEditor.Text; | |
| 23: | ||
| 24: | namespace SharpDevelop.DefaultEditor.Actions { | |
| 25: | ||
| 26: | public class ShiftCaretRight : CaretRight | |
| 27: | { | |
| 28: | public override void Execute(IEditActionServices services) | |
| 29: | { | |
| 30: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 31: | base.Execute(services); | |
| 32: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 33: | } | |
| 34: | } | |
| 35: | ||
| 36: | ||
| 37: | public class ShiftCaretLeft : CaretLeft | |
| 38: | { | |
| 39: | public override void Execute(IEditActionServices services) | |
| 40: | { | |
| 41: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 42: | base.Execute(services); | |
| 43: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 44: | } | |
| 45: | } | |
| 46: | ||
| 47: | public class ShiftCaretUp : CaretUp | |
| 48: | { | |
| 49: | public override void Execute(IEditActionServices services) | |
| 50: | { | |
| 51: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 52: | base.Execute(services); | |
| 53: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 54: | } | |
| 55: | } | |
| 56: | ||
| 57: | public class ShiftCaretDown : CaretDown | |
| 58: | { | |
| 59: | public override void Execute(IEditActionServices services) | |
| 60: | { | |
| 61: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 62: | base.Execute(services); | |
| 63: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 64: | } | |
| 65: | } | |
| 66: | ||
| 67: | public class ShiftWordRight : WordRight | |
| 68: | { | |
| 69: | public override void Execute(IEditActionServices services) | |
| 70: | { | |
| 71: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 72: | base.Execute(services); | |
| 73: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 74: | } | |
| 75: | } | |
| 76: | ||
| 77: | public class ShiftWordLeft : WordLeft | |
| 78: | { | |
| 79: | public override void Execute(IEditActionServices services) | |
| 80: | { | |
| 81: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 82: | base.Execute(services); | |
| 83: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 84: | } | |
| 85: | } | |
| 86: | ||
| 87: | public class ShiftHome : Home | |
| 88: | { | |
| 89: | public override void Execute(IEditActionServices services) | |
| 90: | { | |
| 91: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 92: | base.Execute(services); | |
| 93: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 94: | } | |
| 95: | } | |
| 96: | ||
| 97: | public class ShiftEnd : End | |
| 98: | { | |
| 99: | public override void Execute(IEditActionServices services) | |
| 100: | { | |
| 101: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 102: | base.Execute(services); | |
| 103: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 104: | } | |
| 105: | } | |
| 106: | ||
| 107: | public class ShiftMoveToStart : MoveToStart | |
| 108: | { | |
| 109: | public override void Execute(IEditActionServices services) | |
| 110: | { | |
| 111: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 112: | base.Execute(services); | |
| 113: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 114: | } | |
| 115: | } | |
| 116: | ||
| 117: | public class ShiftMoveToEnd : MoveToEnd | |
| 118: | { | |
| 119: | public override void Execute(IEditActionServices services) | |
| 120: | { | |
| 121: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 122: | base.Execute(services); | |
| 123: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 124: | } | |
| 125: | } | |
| 126: | ||
| 127: | public class ShiftMovePageUp : MovePageUp | |
| 128: | { | |
| 129: | public override void Execute(IEditActionServices services) | |
| 130: | { | |
| 131: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 132: | base.Execute(services); | |
| 133: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 134: | } | |
| 135: | } | |
| 136: | ||
| 137: | public class ShiftMovePageDown : MovePageDown | |
| 138: | { | |
| 139: | public override void Execute(IEditActionServices services) | |
| 140: | { | |
| 141: | int oldCaretOffset = services.Document.Caret.Offset; | |
| 142: | base.Execute(services); | |
| 143: | services.ExtendSelection(oldCaretOffset, services.Document.Caret.Offset); | |
| 144: | } | |
| 145: | } | |
| 146: | ||
| 147: | public class SelectWholeDocument : AbstractEditAction | |
| 148: | { | |
| 149: | public override void Execute(IEditActionServices services) | |
| 150: | { | |
| 151: | services.AddToSelection(new TextSelection(services.Document, 0, services.Document.TextLength)); | |
| 152: | } | |
| 153: | } | |
| 154: | ||
| 155: | public class ClearAllSelections : AbstractEditAction | |
| 156: | { | |
| 157: | public override void Execute(IEditActionServices services) | |
| 158: | { | |
| 159: | string text = services.Document.TextContent; | |
| 160: | services.ClearSelection(); | |
| 161: | } | |
| 162: | } | |
| 163: | } |
This page was automatically generated by SharpDevelop.