示例#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
        public VariableBindingSubscriber <T> RegisterVariable <T>(BindingInfo info)
        {
            var binding = new VariableBinding <T>(info, context);

            bindings.Add(binding);
            return(new VariableBindingSubscriber <T>(binding));
        }
示例#3
0
        protected override void Awake()
        {
            base.Awake();

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

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

            inputField = GetComponent <TMP_InputField>();
        }
示例#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;
        }
示例#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;
        }
示例#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;
        }
示例#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);
        }
示例#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);
        }
示例#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));
示例#11
0
 protected virtual void Awake()
 {
     binding = new VariableBinding <object>(bindingInfo, this);
     binding.Property.Changed += SetData;
 }
示例#12
0
        protected override void Awake()
        {
            base.Awake();

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