예제 #1
0
 public PasteCommand(TextEditorFactory editor, CommandFactory factory)
     : base(editor, factory)
 {
     _selStart = editor.SelectionStart;
     _selText = editor.SelectedText;
     _pasteLen = Clipboard.GetText().Length;
 }
예제 #2
0
 public MainWindow()
 {
     InitializeComponent();
     _strat = new HTMLHighlightingStrategy(this.richTextBox);
     _editor = new CommandLibrary.TextEditorFactory(this._textBox, _strat);
     _factory = new CommandFactory(_editor);
     _editor.Strategy.DoHighlight();
 }
예제 #3
0
 public CopyCommand(TextEditorFactory editor, CommandFactory factory)
     : base(editor, factory)
 {
 }
예제 #4
0
 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();
     }
 }
예제 #5
0
 public OpenFileCommand(TextEditorFactory editor, CommandFactory factory)
     : base(editor, factory)
 {
 }
예제 #6
0
 public UndoableCommand(TextEditorFactory editor, CommandFactory factory)
     : base(editor, factory)
 {
 }
예제 #7
0
 public UndoCommand(TextEditorFactory editor, CommandFactory factory)
     : base(editor, factory)
 {
     _commandStack = new Stack<UndoableCommand>();
 }
예제 #8
0
 public BaseCommand(TextEditorFactory editor, CommandFactory factory)
 {
     _editor = editor;
     _factory = factory;
 }