protected internal override void Define() { On((Attach x) => observer = x.Observer); On((Publish x) => observer.Notify(new Notification { Text = x.Text })); }
void IObserverCollection.Add(ObserverRef observer) { if (subscriptions.Any(x => x == observer)) return; subscriptions.Add(observer); }
public void Equatable_by_path() { var ref1 = new ObserverRef(ObserverPath.From("42"), null); var ref2 = new ObserverRef(ObserverPath.From("42"), null); Assert.True(ref1 == ref2); Assert.True(ref1.Equals(ref2)); }
void IObserverCollection.Add(ObserverRef observer) { if (subscriptions.Any(x => x == observer)) { return; } subscriptions.Add(observer); }
public Subscribe(ObserverRef observer) { Observer = observer; }
void On(AttachClientViaPath x) => observer = System.ClientOf(x.ClientPath);
void On(Attach x) => observer = x.Observer;
public static void Notify <TEvent>(this ObserverRef @ref, TEvent @event) where TEvent : Event { @ref.Notify(@event); }
void IObserverCollection.Remove(ObserverRef observer) { subscriptions.Remove(observer); }
void IObserverCollection.Remove(ObserverRef observer) { RecordedSubscriptions.Remove(observer); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return(ObserverRef.Resolve((string)reader.Value)); }
public Attach(ObserverRef observer) { Observer = observer; }