/// <summary> /// Unsubscribes the given object from changes in the active snapshot. /// </summary> /// <param name="snapshotObserver">The object to observe active snapshot changes.</param> public void Unsubscribe(ISnapshotObserver snapshotObserver) { lock (this.ObserverLock) { if (this.SnapshotObservers.Contains(snapshotObserver)) { this.SnapshotObservers.Remove(snapshotObserver); } } }
/// <summary> /// Unsubscribes the given object from changes in the active snapshot. /// </summary> /// <param name="snapshotObserver">The object to observe active snapshot changes.</param> public static void Unsubscribe(ISnapshotObserver snapshotObserver) { lock (SnapshotManager.ObserverLock) { if (SnapshotManager.SnapshotObservers.Contains(snapshotObserver)) { SnapshotManager.SnapshotObservers.Remove(snapshotObserver); } } }
/// <summary> /// Subscribes the given object to changes in the active snapshot. /// </summary> /// <param name="snapshotObserver">The object to observe active snapshot changes.</param> public void Subscribe(ISnapshotObserver snapshotObserver) { lock (this.ObserverLock) { if (!this.SnapshotObservers.Contains(snapshotObserver)) { this.SnapshotObservers.Add(snapshotObserver); snapshotObserver.Update(this.GetActiveSnapshot(createIfNone: false)); } } }
/// <summary> /// Subscribes the given object to changes in the active snapshot. /// </summary> /// <param name="snapshotObserver">The object to observe active snapshot changes.</param> public void Subscribe(ISnapshotObserver snapshotObserver) { lock (this.ObserverLock) { if (!this.SnapshotObservers.Contains(snapshotObserver)) { this.SnapshotObservers.Add(snapshotObserver); snapshotObserver.Update(this.GetSnapshot(SnapshotRetrievalMode.FromActiveSnapshot)); } } }
/// <summary> /// Subscribes the given object to changes in the active snapshot. /// </summary> /// <param name="snapshotObserver">The object to observe active snapshot changes.</param> public static void Subscribe(ISnapshotObserver snapshotObserver) { lock (SnapshotManager.ObserverLock) { if (!SnapshotManager.SnapshotObservers.Contains(snapshotObserver)) { SnapshotManager.SnapshotObservers.Add(snapshotObserver); snapshotObserver.Update(SnapshotManager.GetSnapshot(Snapshot.SnapshotRetrievalMode.FromActiveSnapshot, null)); } } }