public V GetObserver <V>() where V : IObserveComponent <T> { if (!isInitialized) { Debug.LogAssertion(NotYetObservingMessage); } return((V)Observers.FirstOrDefault(c => c is V)); }
public void CloseObserver(ObserverDefinition definition) { ObserverHandle handle = Observers.FirstOrDefault(observerForm => Equals(observerForm.Observer.Definition, definition)); if (handle == null) { Log.Warn("Observer with {@definition} not found, cannot close", definition); return; } handle.Dispose(); Observers.Remove(handle); RefreshObserverRequests(); }