Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
        public VariableBindingSubscriber <T> RegisterVariable <T>(BindingInfo info)
        {
            var binding = new VariableBinding <T>(info, context);

            bindings.Add(binding);
            return(new VariableBindingSubscriber <T>(binding));
        }
Ejemplo n.º 3
0
        protected override void Awake()
        {
            base.Awake();

            offsetBinding = new VariableBinding <Vector2>(offset, this);
            offsetBinding.Property.Changed += OnOffsetBindingChanged;
        }
Ejemplo n.º 4
0
        protected override void Awake()
        {
            base.Awake();

            textBinding = new VariableBinding <object>(text, this);
            textBinding.Property.Changed += OnTextBindingPropertyChanged;

            inputField = GetComponent <TMP_InputField>();
        }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
0
        protected override void Awake()
        {
            base.Awake();

            exposedCommand = new ObservableCommand();
            exposedCommand.ExecuteRequested += OnExposedCommandExecuteRequested;
            ViewModel = new CommandViewModel(exposedCommand);

            commandBinding = new CommandBinding <T>(commandBindingInfo, this);
            commandBinding.Property.CanExecute.Changed += OnCommandCanExecuteChanged;

            decorationBinding = new VariableBinding <T>(DecorationBindingInfo, this);
        }
Ejemplo n.º 10
0
        public BindingList(Component context, BindingInfoList infoList)
        {
            bindingList = new List <VariableBinding <T> >();
            values      = new List <T>();

            for (int i = 0; i < infoList.BindingInfos.Count; i++)
            {
                BindingInfo current     = infoList.BindingInfos[i];
                var         newVariable = new VariableBinding <T>(current, context);
                int         index       = i;
                newVariable.Property.Changed += newValue => OnBoundVariableChanged(index, newValue);
                bindingList.Add(newVariable);
                values.Add(newVariable.Property.GetValue(default));
Ejemplo n.º 11
0
 protected virtual void Awake()
 {
     binding = new VariableBinding <object>(bindingInfo, this);
     binding.Property.Changed += SetData;
 }
Ejemplo n.º 12
0
        protected override void Awake()
        {
            base.Awake();

            fallbackBinding = new VariableBinding <TTo>(Fallback, this);
        }