예제 #1
0
        //Insert actions at the beggining
        public void Register(IActionElement actionElement)
        {
            IMotionActionElement motion = actionElement as IMotionActionElement;

            if (motion != null)
            {
                _motionActions.Insert(0, motion);
            }

            IPointingActionElement pointing = actionElement as IPointingActionElement;

            if (pointing != null)
            {
                _pointingActions.Insert(0, pointing);
            }

            IPressedActionElement pressed = actionElement as IPressedActionElement;

            if (pressed != null)
            {
                _pressedActions.Insert(0, pressed);
            }

            IClickActionElement click = actionElement as IClickActionElement;

            if (click != null)
            {
                _clickActions.Insert(0, click);
            }

            ResetAssignedActions();
        }
 // note that I'm using the IActionElement interface here. Not the class that implements the interface like you do
 public Pineapple Given(IActionElement <Adapter> adapter)
 {
     actionElement = adapter;
     queue         = new Queue <Actions>();
     return(this);
 }