public void InvokeFromToken(IValueContainer valueContainer, IDisposableTreeHandleable owner) { // When token is canceled, don't invoke the callback. if (_valueContainer != null) { // Owner is in the event queue, just release the container. _valueContainer.Release(); _valueContainer = null; } else { _previous.Remove(owner); owner.Dispose(); } }
public void InvokeFromPromise(ITraceable owner) { try { _callback.Invoke(new ReasonContainer(_valueContainer)); } finally { _valueContainer.Release(); } }