private void enqueueEvents(Drawable child, LifetimeState oldState, LifetimeState newState) { Debug.Assert(oldState != newState); switch (oldState) { case LifetimeState.Future: eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.Start, LifetimeBoundaryCrossingDirection.Forward)); if (newState == LifetimeState.Past) { eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Forward)); } break; case LifetimeState.Current: eventQueue.Enqueue(newState == LifetimeState.Past ? new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Forward) : new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.Start, LifetimeBoundaryCrossingDirection.Backward)); break; case LifetimeState.Past: eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Backward)); if (newState == LifetimeState.Future) { eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.Start, LifetimeBoundaryCrossingDirection.Backward)); } break; } }
public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { lock (this.ThisLock) { this.ThrowIfNotOpened(); this.state = LifetimeState.Closing; } return(this.OnBeginClose(timeout, callback, state)); }
public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { lock (this.ThisLock) { this.ThrowIfNotOpened(); this.state = LifetimeState.Closing; } return this.OnBeginClose(timeout, callback, state); }
public void Close(TimeSpan timeout) { lock (this.ThisLock) { this.ThrowIfNotOpened(); this.state = LifetimeState.Closing; } this.OnClose(timeout); this.state = LifetimeState.Closed; }
public void Close(TimeSpan timeout) { lock (ThisLock) { ThrowIfNotOpened(); _state = LifetimeState.Closing; } OnClose(timeout); _state = LifetimeState.Closed; }
public async Task CloseAsync(CancellationToken token) { token.ThrowIfCancellationRequested(); lock (ThisLock) { ThrowIfNotOpened(); _state = LifetimeState.Closing; } await OnCloseAsync(token); _state = LifetimeState.Closed; }
public void Abort() { lock (this.ThisLock) { if (this.State == LifetimeState.Closed || _aborted) return; _aborted = true; _state = LifetimeState.Closing; } this.OnAbort(); _state = LifetimeState.Closed; }
public void Abort() { lock (this.ThisLock) { if ((this.State == LifetimeState.Closed) || this.aborted) { return; } this.aborted = true; this.state = LifetimeState.Closing; } this.OnAbort(); this.state = LifetimeState.Closed; }
private SortedSet <ChildEntry> futureOrPastChildren(LifetimeState state) { switch (state) { case LifetimeState.Future: return(futureChildren); case LifetimeState.Past: return(pastChildren); default: return(null); } }
public void Abort() { lock (ThisLock) { if (State == LifetimeState.Closed || _aborted) { return; } _aborted = true; _state = LifetimeState.Closing; } OnAbort(); _state = LifetimeState.Closed; }
public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { lock (this.ThisLock) { this.ThrowIfNotOpened(); #if DEBUG_EXPENSIVE if (closeStack == null) { closeStack = new StackTrace(); } #endif this.state = LifetimeState.Closing; } return(this.OnBeginClose(timeout, callback, state)); }
public void Abort() { lock (this.ThisLock) { if (this.State == LifetimeState.Closed || this.aborted) return; #if DEBUG_EXPENSIVE if (closeStack == null) closeStack = new StackTrace(); #endif this.aborted = true; this.state = LifetimeState.Closing; } this.OnAbort(); this.state = LifetimeState.Closed; }
public void Close(TimeSpan timeout) { lock (this.ThisLock) { this.ThrowIfNotOpened(); #if DEBUG_EXPENSIVE if (closeStack == null) { closeStack = new StackTrace(); } #endif this.state = LifetimeState.Closing; } this.OnClose(timeout); this.state = LifetimeState.Closed; }
public void Abort() { lock (this.ThisLock) { if (this.State == LifetimeState.Closed || this.aborted) { return; } #if DEBUG_EXPENSIVE if (closeStack == null) { closeStack = new StackTrace(); } #endif this.aborted = true; this.state = LifetimeState.Closing; } this.OnAbort(); this.state = LifetimeState.Closed; }
public void EndClose(IAsyncResult result) { OnEndClose(result); _state = LifetimeState.Closed; }
public LifetimeManager(object mutex) { _mutex = mutex; _state = LifetimeState.Opened; }
/// <summary>To be documented.</summary> public readonly void LifetimeStateUpdated(LifetimeState NewState) { var @this = (ID3D12LifetimeOwner *)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); ((delegate * unmanaged[Cdecl] < ID3D12LifetimeOwner *, LifetimeState, void >)LpVtbl[3])(@this, NewState); }
public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { lock (this.ThisLock) { this.ThrowIfNotOpened(); #if DEBUG_EXPENSIVE if (closeStack == null) closeStack = new StackTrace(); #endif this.state = LifetimeState.Closing; } return this.OnBeginClose(timeout, callback, state); }
public LifetimeManager(object mutex) { this.mutex = mutex; this.state = LifetimeState.Opened; }
public void EndClose(IAsyncResult result) { this.OnEndClose(result); _state = LifetimeState.Closed; }
public void Next() { this.CurrentState = this.NextState; this.NextState = LifetimeState.Unchanged; }
public LifetimeManager(object mutex) { ThisLock = mutex; _state = LifetimeState.Opened; }
public void EndClose(IAsyncResult result) { this.OnEndClose(result); this.state = LifetimeState.Closed; }
public void Change() => this.NextState = LifetimeState.Changed;
public void Close(TimeSpan timeout) { lock (this.ThisLock) { this.ThrowIfNotOpened(); #if DEBUG_EXPENSIVE if (closeStack == null) closeStack = new StackTrace(); #endif this.state = LifetimeState.Closing; } this.OnClose(timeout); this.state = LifetimeState.Closed; }
public void Remove() => this.NextState = LifetimeState.Removed;