public void Release(IResourceRequest request) { IResource originator = m_wrappedByWhom ?? this; RequestEvent?.Invoke(request, originator); lock (this) { AttemptReturnToService(request); ReleasedEvent?.Invoke(request, originator); } }
/// <summary> /// Releases the specified request. Returns it to availability and the resource pool. /// </summary> /// <param name="request">The request.</param> public void Release(IResourceRequest request) { lock (this) { DoRollback(request); ReleasedEvent?.Invoke(request, this); ResourceReleased?.Invoke(request, this); } while (m_waiters.Count > 0) { IDetachableEventController dec = (IDetachableEventController)m_waiters[0]; m_waiters.RemoveAt(0); dec.Resume(); } }
public KeyEvent(Keys k, ReleasedEvent d) { Key = k; Released = d; }
public ButtonEvent(Buttons b, ReleasedEvent d) { Button = b; Released = d; }
public void SetTouchActions(ReleasedEvent left, ReleasedEvent right, ReleasedEvent up, ReleasedEvent down) { _touchevents[(int) TouchAction.MoveLeft] = left; _touchevents[(int) TouchAction.MoveRight] = right; _touchevents[(int) TouchAction.MoveUp] = up; _touchevents[(int) TouchAction.MoveDown] = down; }
public void Add(Buttons button, Keys key, ReleasedEvent callback) { _buttons[_freeSlot] = new ButtonEvent(button, callback); _keys[_freeSlot] = new KeyEvent(key, callback); _freeSlot++; }