public override void Process(ExecutionContext context)
        {
            // Deal with new button controllers
            if (ButtonPort.HasData())
            {
                // Unsubscribe from the previous button if necessary
                if (button != null)
                {
                    button.UnsubscribeFromEvents(ButtonEventsPort);
                }

                // Get the button
                button = (ButtonController)ButtonPort.GetData();

                // Subscribe to the new button
                button.SubscribeToEvents(ButtonEventsPort);
            }

            // Send a kick for each button event received
            for (int i = 0; i < ButtonEventsPort.GetDataCount(); i++)
            {
                Output.Send(OnPressPort, Kick.Instance, context);
            }
            ButtonEventsPort.ClearData();
        }
Exemple #2
0
 public override void Process(ExecutionContext context)
 {
     if (ObjectPort.HasData())
     {
         object data = ObjectPort.GetData();
         for (int i = 0; i < SendPort.GetDataCount(); i++)
         {
             OutPort.Send(data, context);
         }
         SendPort.ClearData();
     }
     Output.Done(context);
 }