Пример #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;
 }