private void RemoveParameter([NotNull] ActionParameterViewModelBase parameter)
        {
            Assert.ArgumentNotNull(parameter, "parameter");

            parameter.ParameterTypeChanged -= ChangeParameterType;
            _originalParameters.Remove(parameter.Parameter);
            _parameters.Remove(parameter);

            MoveParameterDownCommand.UpdateCanExecute();
            MoveParameterUpCommand.UpdateCanExecute();

            OnPropertyChanged("ParametersCollectionEmpty");
            OnPropertyChanged("ActionParametersDescription");
        }
        private void AddParameter([NotNull] ActionParameterViewModelBase parameterToAdd)
        {
            Assert.ArgumentNotNull(parameterToAdd, "parameterToAdd");

            parameterToAdd.ParameterTypeChanged += ChangeParameterType;
            parameterToAdd.PropertyChanged      += HandleParameterDescriptionChanged;
            _parameters.Add(parameterToAdd);
            _originalParameters.Add(parameterToAdd.Parameter);
            MoveParameterDownCommand.UpdateCanExecute();
            MoveParameterUpCommand.UpdateCanExecute();

            OnPropertyChanged("ParametersCollectionEmpty");
            OnPropertyChanged("ActionParametersDescription");
        }
        private void AddParameter([NotNull] ParameterDescription newParameterDescription, int originalIndex)
        {
            Assert.ArgumentNotNull(newParameterDescription, "newParameterDescription");

            var newParameter = CreateNewActionParameterFromType(newParameterDescription);

            newParameter.ParameterTypeChanged += ChangeParameterType;
            newParameter.PropertyChanged      += HandleParameterDescriptionChanged;
            _parameters.Insert(originalIndex, newParameter);
            _originalParameters.Insert(originalIndex, newParameter.Parameter);
            MoveParameterDownCommand.UpdateCanExecute();
            MoveParameterUpCommand.UpdateCanExecute();

            OnPropertyChanged("ParametersCollectionEmpty");
            OnPropertyChanged("ActionParametersDescription");
        }
        private void MoveParameterUpCommandExecute([CanBeNull] object obj)
        {
            var castedParameter = obj as ActionParameterViewModelBase;

            if (castedParameter != null)
            {
                var originalIndex = Parameters.IndexOf(castedParameter);
                var tempParam     = _originalParameters[originalIndex];
                _originalParameters[originalIndex]     = _originalParameters[originalIndex - 1];
                _originalParameters[originalIndex - 1] = tempParam;
                _parameters.Move(originalIndex, originalIndex - 1);
            }

            MoveParameterDownCommand.UpdateCanExecute();
            MoveParameterUpCommand.UpdateCanExecute();
            OnPropertyChanged("ActionParametersDescription");
        }