protected override async ValueTask <bool> TryInvokeAsync(ObservablePropertyStateChangedArgs e) { if (consumer == null) { return(false); } if (!consumer.IsAlive()) { return(true); } IObservableProperty observableProperty = e.ObservableProperty; string propertyName = e.PropertyInfo.Name; if (observableContainers.TryGetValue(observableProperty, out IObservableContainer container)) { if (container.IsSubscribed(propertyName)) { await consumer.ForceUpdate(); return(true); } } return(false); }
public void NotifyPropertyStateChanged(ObservablePropertyStateChangedArgs args) { foreach (var subscriber in subscribers) { InvokeActionOrRemove(subscriber.Key, subscriber => subscriber.PropertyStateChangedAsync(args)); } }
protected async override ValueTask <bool> TryInvokeAsync(ObservablePropertyStateChangedArgs e) { if (!initialized) { initialized = true; if (reactable.RequiresInitialInvoke()) { await InvokeInternalAsync(true); return(true); } } if (observableContainers.TryGetValue(e.ObservableProperty, out IObservableContainer container)) { if (container.IsSubscribed(e.PropertyInfo.Name)) { await InvokeInternalAsync(false); return(true); } } return(false); }
private void OnPropertyStateChanged(object sender, ObservablePropertyStateChangedArgs e) { bool executed = transactionLock.TryExecuteWithWriteLock(() => { Subscribers.NotifyPropertyStateChanged(e); }); if (!executed) { propertyStateChangedQueue.Enqueue(e); return; } DequeueAll(); }
private void OnPropertyStateChanged(object sender, ObservablePropertyStateChangedArgs e) { Subscribers.NotifyPropertyStateChanged(e); }