public PropertyDispatching( TSource source, string propertyName, IOcDispatcher destinationOcDispatcher, IOcDispatcher sourceOcDispatcher = null, int destinationOcDispatcherPriority = 0, int sourceOcDispatcherPriority = 0, object destinationOcDispatcherParameter = null, object sourceOcDispatcherParameter = null) { _sourceOcDispatcher = sourceOcDispatcher; _destinationOcDispatcher = destinationOcDispatcher; _source = source; _propertyName = propertyName; _destinationOcDispatcherPriority = destinationOcDispatcherPriority; _sourceOcDispatcherPriority = sourceOcDispatcherPriority; _destinationOcDispatcherParameter = destinationOcDispatcherParameter; _sourceOcDispatcherParameter = sourceOcDispatcherParameter; PropertyChanged += (sender, args) => { if (args == Utils.SetValueRequestHandlerPropertyChangedEventArgs) { throw new ObservableComputationsException( $"Cannot set property {nameof(PropertyDispatching<TSource, TResult>)}.{nameof(SetValueRequestHandler)}, since that it is predefined"); } }; }
public ScalarDispatching( IReadScalar <TResult> source, IOcDispatcher destinationOcDispatcher, IOcDispatcher sourceOcDispatcher = null, int destinationOcDispatcherPriority = 0, int sourceOcDispatcherPriority = 0, object destinationOcDispatcherParameter = null, object sourceOcDispatcherParameter = null) { _destinationOcDispatcher = destinationOcDispatcher; _source = source; _sourceOcDispatcher = sourceOcDispatcher; _changeValueAction = () => { TResult newValue = _source.Value; void setNewValue() => setValue(newValue); _destinationOcDispatcher.Invoke( setNewValue, _destinationOcDispatcherPriority, _destinationOcDispatcherParameter, this); }; _destinationOcDispatcherPriority = destinationOcDispatcherPriority; _sourceOcDispatcherPriority = sourceOcDispatcherPriority; _destinationOcDispatcherParameter = destinationOcDispatcherParameter; _sourceOcDispatcherParameter = sourceOcDispatcherParameter; }
public ThrottlingDispatcher(TimeSpan timeSpan, IOcDispatcher destinationOcDispatcher) { _timeSpan = timeSpan; _destinationOcDispatcher = destinationOcDispatcher; _actions = new Subject <Action>(); _cleanUp = _actions.Throttle(timeSpan).Subscribe(action => { _destinationOcDispatcher.Invoke(action, 0, null, this); }); }
public CollectionDispatching( IReadScalar <INotifyCollectionChanged> sourceScalar, IOcDispatcher destinationOcDispatcher, IOcDispatcher sourceOcDispatcher = null, int destinationOcDispatcherPriority = 0, int sourceOcDispatcherPriority = 0, object destinationOcDispatcherParameter = null, object sourceOcDispatcherParameter = null) : this(destinationOcDispatcherPriority, sourceOcDispatcherPriority, destinationOcDispatcherParameter, sourceOcDispatcherParameter) { _destinationOcDispatcher = destinationOcDispatcher; _sourceOcDispatcher = sourceOcDispatcher; _sourceScalar = sourceScalar; }
public PropertyDispatching( Expression <Func <TResult> > propertyExpression, IOcDispatcher destinationOcDispatcher, IOcDispatcher sourceOcDispatcher = null, int destinationOcDispatcherPriority = 0, int sourceOcDispatcherPriority = 0, object destinationOcDispatcherParameter = null, object sourceOcDispatcherParameter = null) : this() { _sourceOcDispatcher = sourceOcDispatcher; _destinationOcDispatcher = destinationOcDispatcher; _propertyExpression = propertyExpression; _destinationOcDispatcherPriority = destinationOcDispatcherPriority; _sourceOcDispatcherPriority = sourceOcDispatcherPriority; _destinationOcDispatcherParameter = destinationOcDispatcherParameter; _sourceOcDispatcherParameter = sourceOcDispatcherParameter; lockChangeSetValueHandle(); }
public static void Invoke(this IOcDispatcher ocDispatcher, Action action, int priority = 0, object parameter = null, object context = null) { ocDispatcher.Invoke(action, priority, parameter, context); }
public UserInputThrottlingOcDispatcher(IOcDispatcher destinationOcDispatcher) : base(TimeSpan.FromMilliseconds(250), destinationOcDispatcher) { }