public PasteCommand(TextEditorFactory editor, CommandFactory factory) : base(editor, factory) { _selStart = editor.SelectionStart; _selText = editor.SelectedText; _pasteLen = Clipboard.GetText().Length; }
public MainWindow() { InitializeComponent(); _strat = new HTMLHighlightingStrategy(this.richTextBox); _editor = new CommandLibrary.TextEditorFactory(this._textBox, _strat); _factory = new CommandFactory(_editor); _editor.Strategy.DoHighlight(); }
public CopyCommand(TextEditorFactory editor, CommandFactory factory) : base(editor, factory) { }
private void TextBoxKeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.S) { MessageBox.Show("Executed save"); _cmdFactory = new CommandFactory(this); _cmdFactory.SaveFileCmd().Execute(); } if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.O) { MessageBox.Show("Executed open"); _cmdFactory = new CommandFactory(this); _cmdFactory.OpenFileCmd().Execute(); } }
public OpenFileCommand(TextEditorFactory editor, CommandFactory factory) : base(editor, factory) { }
public UndoableCommand(TextEditorFactory editor, CommandFactory factory) : base(editor, factory) { }
public UndoCommand(TextEditorFactory editor, CommandFactory factory) : base(editor, factory) { _commandStack = new Stack<UndoableCommand>(); }
public BaseCommand(TextEditorFactory editor, CommandFactory factory) { _editor = editor; _factory = factory; }