Пример #1
0
 protected VariableBindingProcessor(BindingInfo bindingInfo, Component context)
 {
     processedVariable = new ObservableVariable <TTo>();
     ViewModel         = new OperatorVariableViewModel <TTo>(processedVariable);
     variableBinding   = new VariableBinding <TFrom>(bindingInfo, context);
     variableBinding.Property.Changed += BoundVariableChangedHandler;
 }
Пример #2
0
        protected virtual void Awake()
        {
            exposedProperty = new ObservableVariable <TTo>();
            ViewModel       = new OperatorVariableViewModel <TTo>(exposedProperty);

            bindingList = new BindingList <TFrom>(this, fromBinding);
            bindingList.VariableChanged += BindingListVariableChangedHandler;
        }
Пример #3
0
        protected override void Awake()
        {
            base.Awake();

            exposedVariable = new ObservableVariable <bool>();
            ViewModel       = new OperatorVariableViewModel <bool>(exposedVariable);

            variableBinding = new VariableBinding <object>(variable, this);
            variableBinding.Property.Changed += OnVariableChanged;
            variableBinding.Property.Cleared += OnVariableCleared;
        }
Пример #4
0
        protected virtual void Awake()
        {
            result    = new ObservableVariable <bool>();
            viewModel = new OperatorVariableViewModel <bool>(result);
            ViewModel = viewModel;

            operandABinding = new VariableBinding <double>(operandA, this);
            operandABinding.Property.Changed += OperandChangedHandler;
            operandBBinding = new VariableBinding <double>(operandB, this);
            operandBBinding.Property.Changed += OperandChangedHandler;
        }
Пример #5
0
        protected virtual void Awake()
        {
            exposedProperty = new ObservableVariable <string>();
            ViewModel       = new OperatorVariableViewModel <string>(exposedProperty);

            formatBinding = new VariableBinding <string>(format, this);
            formatBinding.Property.Changed += OnFormatChanged;

            parametersBindingList = new BindingList <object>(this, parameters);
            parametersBindingList.VariableChanged += OnBindingListVariableChanged;
        }
Пример #6
0
        protected override void Awake()
        {
            base.Awake();

            RegisterVariable <T>(source)
            .OnChanged(OnBoundPropertyChanged)
            .OnCleared(OnBoundPropertyCleared);

            initialBinding  = new VariableBinding <T>(InitialValue, this);
            exposedProperty = new ObservableVariable <T>();
            ViewModel       = new OperatorVariableViewModel <T>(exposedProperty);
        }
Пример #7
0
        private bool Evaluate()
        {
            bool result = false;

            switch (operation)
            {
            case MathComparisonType.Equals: result = A == B; break;

            case MathComparisonType.NotEquals: result = A != B; break;

            case MathComparisonType.Greater: result = A > B; break;

            case MathComparisonType.GreaterOrEquals: result = A >= B; break;

            case MathComparisonType.Less: result = A < B; break;

            case MathComparisonType.LessOrEquals: result = A <= B; break;
            }

            return(result);
        }
Пример #8
0
 public CommandBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context)
 {
     canExecuteSource = new ObservableVariable <bool>(false);
     exposedProperty  = new ObservableCommand(canExecuteSource, OnExecuteRequested);
 }
Пример #9
0
 public VariableBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context)
 {
     exposedProperty = new ObservableVariable <T>();
 }