Ejemplo n.º 1
0
        public static void Show()
        {
            var videoEditor = new VideoEditor();
            var history     = new History();

            var setTextCommand = new SetTextCommand("Video Title", videoEditor, history);

            setTextCommand.Execute();
            Console.WriteLine($"Text: {videoEditor}");

            var setContrast = new SetContrastCommand(1, videoEditor, history);

            setContrast.Execute();
            Console.WriteLine($"Contrast: {videoEditor}");

            var undoCommand = new UndoCommand(history);

            undoCommand.Execute();
            Console.WriteLine($"Undo: {videoEditor}");

            undoCommand.Execute();
            Console.WriteLine($"Undo: {videoEditor}");

            undoCommand.Execute();
            Console.WriteLine($"Undo: {videoEditor}");
        }
Ejemplo n.º 2
0
 protected AbstractUndoableCommand(VideoEditor videoEditor, History history)
 {
     _videoEditor = videoEditor;
     _history     = history;
 }
Ejemplo n.º 3
0
 public SetContrastCommand(float contrast, VideoEditor videoEditor, History history)
     : base(videoEditor, history)
 {
     _prevContrast = videoEditor.Contrast;
     _contrast     = contrast;
 }
Ejemplo n.º 4
0
 public SetTextCommand(string text, VideoEditor videoEditor, History history)
     : base(videoEditor, history)
 {
     _text = text;
 }