예제 #1
0
        public void Release(IResourceRequest request)
        {
            IResource originator = m_wrappedByWhom ?? this;

            RequestEvent?.Invoke(request, originator);
            lock (this) {
                AttemptReturnToService(request);
                ReleasedEvent?.Invoke(request, originator);
            }
        }
예제 #2
0
 /// <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();
     }
 }
예제 #3
0
파일: Input.cs 프로젝트: Erquint/Rhetris
 public KeyEvent(Keys k, ReleasedEvent d)
 {
     Key = k;
     Released = d;
 }
예제 #4
0
파일: Input.cs 프로젝트: Erquint/Rhetris
 public ButtonEvent(Buttons b, ReleasedEvent d)
 {
     Button = b;
     Released = d;
 }
예제 #5
0
파일: Input.cs 프로젝트: Erquint/Rhetris
 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;
 }
예제 #6
0
파일: Input.cs 프로젝트: Erquint/Rhetris
 public void Add(Buttons button, Keys key, ReleasedEvent callback)
 {
     _buttons[_freeSlot] = new ButtonEvent(button, callback);
     _keys[_freeSlot] = new KeyEvent(key, callback);
     _freeSlot++;
 }