/// <summary> /// Add the specified monitor, which should already be configured. /// </summary> /// <remarks>The monitor may be polled immediately after it is subscribed so it should be /// configured.</remarks> public static void Subscribe(ILoupeMonitor monitor) { //Add to our *pending* monitors collection so it will be background initialized m_PendingMonitors.Enqueue(monitor); }
/// <inheritdoc /> public bool Equals(ILoupeMonitor monitor) { return(ReferenceEquals(this, monitor)); }
/// <summary> /// Remove the specified monitor. /// </summary> /// <remarks>If the monitor object isn't subscribed no error is raised. If the object is being polled /// there may be a short delay before it is unregistered.</remarks> /// <returns>True if the monitor was previously registered and has now been removed</returns> public static bool Unsubscribe(ILoupeMonitor monitor) { return(m_Monitors.TryRemove(monitor, out var storedMonitor)); }