AGENT.Contrib.Hardware.ButtonHelper.s_OnInterrupt C# (CSharp) Method

s_OnInterrupt() private method

private s_OnInterrupt ( uint data1, uint data2, System.DateTime time ) : void
data1 uint
data2 uint
time System.DateTime
return void
        private void s_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            //data1 is the is the number of the pin of the switch
            //data2 is the value if the button is pushed or released; 0 = down, 1 = up
            if (OnButtonPress != null)
            {
                Buttons _button = (Buttons) data1;
                ButtonDirection _direction = (ButtonDirection) data2;
                InterruptPort _b = null;
                foreach (InterruptPort b in buttonPorts)
                {
                    if ((uint)b.Id == data1)
                    {
                        _b = b;
                        break;
                    }
                }
                if (_b != null) OnButtonPress(_button, _b, _direction, time);

            }

        }