private void SanitizeTypes() { bool didTypeChange = false; if (bindingType == BindingType.Variable && fromBinding.Type != typeof(IReadOnlyObservableVariable <TFrom>)) { fromBinding = new BindingInfo(typeof(IReadOnlyObservableVariable <TFrom>)); expectedType = new SerializableType(typeof(OperatorVariableViewModel <TTo>)); didTypeChange = true; } if (bindingType == BindingType.Collection && fromBinding.Type != typeof(IReadOnlyObservableCollection <TFrom>)) { fromBinding = new BindingInfo(typeof(IReadOnlyObservableCollection <TFrom>)); expectedType = new SerializableType(typeof(OperatorCollectionViewModel <TTo>)); didTypeChange = true; } if (bindingType == BindingType.Command && fromBinding.Type != typeof(IObservableCommand <TTo>)) { fromBinding = new BindingInfo(typeof(IObservableCommand <TTo>)); expectedType = new SerializableType(typeof(OperatorCommandViewModel <TFrom>)); didTypeChange = true; } if (bindingType == BindingType.Event && fromBinding.Type != typeof(IObservableEvent <TFrom>)) { fromBinding = new BindingInfo(typeof(IObservableEvent <TFrom>)); expectedType = new SerializableType(typeof(OperatorEventViewModel <TTo>)); didTypeChange = true; } if (didTypeChange) { BindingInfoTrackerProxy.RefreshBindingInfo(); } }
public SkipCommandBindingProcessor(BindingInfo bindingInfo, Component context, int skipAmount) : base(bindingInfo, context) { this.skipAmount = skipAmount; valueReceivedCount = 0; }
protected override IBindingProcessor GetBindingProcessor(BindingType bindingType, BindingInfo fromBinding) { IBindingProcessor result = null; switch (bindingType) { case BindingType.Variable: result = new TakeVariableBindingProcessor <T>(fromBinding, this, skipAmount); break; case BindingType.Collection: Debug.LogError("Collection take is not supported", this); break; case BindingType.Command: result = new TakeCommandBindingProcessor <T>(fromBinding, this, skipAmount); break; case BindingType.Event: result = new TakeEventBindingProcessor <T>(fromBinding, this, skipAmount); break; } return(result); }
protected override IBindingProcessor GetBindingProcessor(BindingType bindingType, BindingInfo fromBinding) { IBindingProcessor result = null; switch (bindingType) { case BindingType.Variable: result = new TweenVariableBindingProcessor <T>(fromBinding, this, BuildTweener); break; case BindingType.Collection: result = new TweenCollectionBindingProcessor <T>(fromBinding, this, BuildTweener); break; } return(result); }
public VariableBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context) { exposedProperty = new ObservableVariable <T>(); }
public TweenVariableBindingProcessor(BindingInfo bindingInfo, Component context, BuildTweener tweenBuilder) : base(bindingInfo, context) { this.tweenBuilder = tweenBuilder; }
protected CollectionBindingSubscriber <T> RegisterCollection <T>(BindingInfo bindingInfo) { return(bindingTracker.RegisterCollection <T>(bindingInfo)); }
public DelayVariableBindingProcessor(BindingInfo bindingInfo, Component context, float delay) : base(bindingInfo, context) { actionQueue = new Queue <ActionCommand>(); this.delay = delay; }
protected override IBindingProcessor GetBindingProcessor(BindingType bindingType, BindingInfo fromBinding) { IBindingProcessor result = null; switch (bindingType) { case BindingType.Variable: result = new DelayVariableBindingProcessor <T>(fromBinding, this, delay); break; case BindingType.Collection: result = new DelayCollectionBindingProcessor <T>(fromBinding, this, delay); break; case BindingType.Command: result = new DelayCommandBindingProcessor <T>(fromBinding, this, delay); break; case BindingType.Event: result = new DelayEventBindingProcessor <T>(fromBinding, this, delay); break; } return(result); }
public CollectionBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context) { exposedProperty = new ObservableCollection <T>(); }
protected abstract IBindingProcessor GetBindingProcessor(BindingType bindingType, BindingInfo fromBinding);
protected CommandBindingSubscriber <T> RegisterCommand <T>(BindingInfo bindingInfo) { return(bindingTracker.RegisterCommand <T>(bindingInfo)); }
protected EventBindingSubscriber <T> RegisterEvent <T>(BindingInfo bindingInfo) { return(bindingTracker.RegisterEvent <T>(bindingInfo)); }
public ToEventBindingProcessor(BindingInfo bindingInfo, Component context, Func <TFrom, TTo> processFunction) : base(bindingInfo, context) { this.processFunction = processFunction; }
public Binding(BindingInfo bindingInfo, Component context) { this.bindingInfo = bindingInfo; this.context = context; }
public EventBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context) { exposedProperty = new ObservableEvent(); }
public TakeCommandBindingProcessor(BindingInfo bindingInfo, Component context, int takeAmount) : base(bindingInfo, context) { this.takeAmount = takeAmount; valueReceivedCount = 0; }
public CommandBinding(BindingInfo bindingInfo, Component context) : base(bindingInfo, context) { canExecuteSource = new ObservableVariable <bool>(false); exposedProperty = new ObservableCommand(canExecuteSource, OnExecuteRequested); }
protected VariableBindingSubscriber <T> RegisterVariable <T>(BindingInfo bindingInfo) { return(bindingTracker.RegisterVariable <T>(bindingInfo)); }