Example #1
0
        private void Item_Redo_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (HistoryRedo.Count > 0)
                {
                    int last = HistoryRedo.Count - 1;

                    if (HistoryRedo[last] is His_RemovedControl)
                    {
                        SpecialRemoved = true;
                    }

                    HistoryRedo[last].DoRedoAction(DesignCanvas, data);
                    HistoryCommand historyCommand = HistoryRedo[last];
                    HistoryRedo.RemoveAt(last);
                    HistoryUndo.Add(historyCommand);
                    Undo_MI.IsEnabled = true;

                    if (HistoryRedo.Count == 0)
                    {
                        Redo_MI.IsEnabled = false;
                    }
                }
                else
                {
                    Redo_MI.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Redo Error: " + ex);
            }
        }
Example #2
0
 public TexoCommand(
     IEnvironmentService environment,
     IInputHistoryService history)
 {
     this.environment = new EnvironmentCommand(environment);
     this.history     = new HistoryCommand(history);
 }
Example #3
0
 public HistoryEvent(object source, HistoryCommand command, object param1, object param2)
 {
     Source     = source;
     Command    = command;
     Parameter1 = param1;
     Parameter2 = param2;
 }
Example #4
0
        public void Init()
        {
            h = new HistoryCommand();

            h.Add("11");
            h.Add("222");
            h.Add("333");
        }
        public CmdControlViewModel()
        {
            this.DisplayName = "CMD Window";

            historyCommand = new HistoryCommand();
            cmdReader      = new CmdReader();
            cmdReader.Register(this);

            Init();
        }
Example #6
0
        public void ShouldHaveCorrectCommandVersion()
        {
            // Arrange
            var command = new HistoryCommand();

            // Act
            var usage = command.Usage;

            // Assert
            Assert.Equal(string.Format("dbversion {0} [options]", command.Name), usage);
        }
Example #7
0
        public void ShouldHaveCorrectDescription()
        {
            // Arrange
            var command = new HistoryCommand();

            // Act
            var description = command.Description;

            // Assert
            Assert.Equal("Prints out a history of the installed versions.", description);
        }
Example #8
0
        public void ShouldHaveCorrectCommandName()
        {
            // Arrange
            var command = new HistoryCommand();

            // Act
            var name = command.Name;

            // Assert
            Assert.Equal("history", name);
        }
Example #9
0
    public CommandSystem()
    {
        Commands   = new Dictionary <string, Command>();
        CommandLog = new CommandLog();

        DateCommand    dateCommand    = new DateCommand();
        HistoryCommand historyCommand = new HistoryCommand(CommandLog.GetLog, CommandLog.Clear, CommandLog.GetLogById);

        Commands.Add(dateCommand.Name, dateCommand);
        Commands.Add(historyCommand.Name, historyCommand);
    }
        public MainViewModel()
        {
            _dataGrid = new ObservableCollection <DataGrid>();
            _dataGrid = dataGridService.GetCurrent();

            CurrentCommand      = new CurrentCommand(this);
            ReservationCommand  = new ReservationCommand(this);
            HistoryCommand      = new HistoryCommand(this);
            DeleteCommand       = new DeleteCommand(this);
            UpdateCommand       = new UpdateCommand(this);
            AvaibleRoomsCommand = new AvaibleRoomsCommand(this);

            SetButtons(true, false, false, true, true);
        }
Example #11
0
        private HistoryCommand CreateCommand()
        {
            var command = new HistoryCommand();

            command.VersionProvider        = this.versionProvider.Object;
            command.MessageService         = this.messageService;
            command.SessionFactoryProvider = this.sessionFactoryProvider.Object;
            command.SettingsService        = this.settingsService.Object;
            command.PropertyService        = this.propertyService.Object;
            command.ArchiveFactories       = new[] { this.archiveFactory.Object };
            command.SavedConnectionService = this.savedConnectionService.Object;

            return(command);
        }
Example #12
0
        public void Add(object source, HistoryCommand command, object param1, object param2)
        {
            if (_events.Count - 1 > _current)
            {
                for (int i = _events.Count - 1; i > _current; i--)
                {
                    _events.RemoveAt(i);
                }
            }

            // Check if we're at our limit
            if (_events.Count == MaxEvents)
            {
                // Expire the first item in the collection
                _events.RemoveAt(0);
            }

            _events.Add(new HistoryEvent(source, command, param1, param2));
            _current = _events.Count - 1;
        }