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

            SecondOperand = ActionParametersViewModel.CreateNewActionParameterFromType(newparameterdescription);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="StartLogActionViewModel"/> class.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="actionDescriptor">The action descriptor.</param>
        /// <param name="parameterDescriptions">The parameter descriptions.</param>
        /// <param name="allDescriptions">All descriptions.</param>
        public StartLogActionViewModel([NotNull] StartLogAction action, [NotNull] ActionDescription actionDescriptor, [NotNull] IEnumerable <ParameterDescription> parameterDescriptions, [NotNull] IEnumerable <ActionDescription> allDescriptions)
            : base(action, actionDescriptor, allDescriptions)
        {
            Assert.ArgumentNotNull(action, "action");
            Assert.ArgumentNotNull(actionDescriptor, "actionDescriptor");
            Assert.ArgumentNotNull(parameterDescriptions, "parameterDescriptions");
            Assert.ArgumentNotNull(allDescriptions, "allDescriptions");

            _action = action;
            ParameterDescriptions = parameterDescriptions;

            _logNameParameter = ActionParametersViewModel.CreateParameterViewModel(_action.LogNameParameter, parameterDescriptions);
            _logNameParameter.PropertyChanged += HandleLogNameParameterDescriptionChange;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SetVariableValueActionViewModel"/> class.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="actionDescriptor">The action descriptor.</param>
        /// <param name="parameterDescriptions">The parameter descriptions.</param>
        /// <param name="allDescriptions">All descriptions.</param>
        public SetVariableValueActionViewModel([NotNull] SetVariableValueAction action, [NotNull] ActionDescription actionDescriptor, [NotNull] IEnumerable <ParameterDescription> parameterDescriptions, [NotNull] IEnumerable <ActionDescription> allDescriptions)
            : base(action, actionDescriptor, allDescriptions)
        {
            Assert.ArgumentNotNull(action, "action");
            Assert.ArgumentNotNull(actionDescriptor, "actionDescriptor");
            Assert.ArgumentNotNull(parameterDescriptions, "parameterDescriptions");
            Assert.ArgumentNotNull(allDescriptions, "allDescriptions");

            // AllVariables = allVariables;
            _action = action;
            ParameterDescriptions        = parameterDescriptions;
            _valueToSet                  = ActionParametersViewModel.CreateParameterViewModel(action.ValueToSet, parameterDescriptions);
            _valueToSet.PropertyChanged += HandleValueToSetDescriptionChange;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MathExpressionParameterViewModel"/> class.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        /// <param name="parameterDescriptor">The parameter descriptor.</param>
        /// <param name="allParameterDescriptions">All parameter descriptions.</param>
        public MathExpressionParameterViewModel([NotNull] MathExpressionParameter parameter, [NotNull] ParameterDescription parameterDescriptor, [NotNull] IEnumerable <ParameterDescription> allParameterDescriptions)
            : base(parameter, parameterDescriptor, allParameterDescriptions)
        {
            Assert.ArgumentNotNull(parameter, "parameter");
            Assert.ArgumentNotNull(parameterDescriptor, "parameterDescriptor");
            Assert.ArgumentNotNull(allParameterDescriptions, "allParameterDescriptions");

            _parameter           = parameter;
            _parameterDescriptor = parameterDescriptor;
            _firstOperand        = ActionParametersViewModel.CreateParameterViewModel(parameter.FirstOperand, allParameterDescriptions);
            _secondOperand       = ActionParametersViewModel.CreateParameterViewModel(parameter.SecondOperand, allParameterDescriptions);

            _firstOperand.PropertyChanged  += HandleOperandDescriptionChange;
            _secondOperand.PropertyChanged += HandleOperandDescriptionChange;

            _firstOperand.ParameterTypeChanged  += HandleFirstOperandTypeChange;
            _secondOperand.ParameterTypeChanged += HandleSecondOperandTypeChange;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConditionalActionViewModel"/> class.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="actionDescriptor">The action descriptor.</param>
        /// <param name="allDescriptors">All descriptors.</param>
        /// <param name="parameterDescriptions">The parameter descriptions.</param>
        public ConditionalActionViewModel([NotNull] ConditionalAction action, [NotNull] ActionDescription actionDescriptor, [NotNull] IEnumerable <ActionDescription> allDescriptors, [NotNull] IEnumerable <ParameterDescription> parameterDescriptions)
            : base(action, actionDescriptor, allDescriptors)
        {
            Assert.ArgumentNotNull(action, "action");
            Assert.ArgumentNotNull(actionDescriptor, "actionDescriptor");
            Assert.ArgumentNotNull(allDescriptors, "allDescriptors");
            Assert.ArgumentNotNull(parameterDescriptions, "parameterDescriptions");

            _action                 = action;
            _allDescriptors         = allDescriptors;
            ParameterDescriptions   = parameterDescriptions;
            _leftConditionParameter = ActionParametersViewModel.CreateParameterViewModel(_action.LeftConditionParameter, parameterDescriptions);
            _leftConditionParameter.PropertyChanged += HandleParameterOrActionDescriptionChange;
            _rightConditionParameter = ActionParametersViewModel.CreateParameterViewModel(_action.RightConditionParameter, parameterDescriptions);
            _rightConditionParameter.PropertyChanged += HandleParameterOrActionDescriptionChange;

            _actionsToExecute = new ActionsViewModel(action.ActionsToExecute, allDescriptors);
            _actionsToExecute.PropertyChanged += HandleParameterOrActionDescriptionChange;
        }