Beispiel #1
0
        internal void BatchCommandReturn(byte[] data)
        {
            if (data != null && _eventButtons != null)
            {
                int c = _eventButtons.Count;
                if (data.Length == c)
                {
                    for (int i = 0; i < c; i++)
                    {
                        bool clicked = data[i] == 1 ? true : false;
                        if (clicked)
                        {
                            ButtonType type = _eventButtons[i];
                            switch (type)
                            {
                            case ButtonType.Any:
                            {
                                Clicked?.Invoke();
                                break;
                            }

                            case ButtonType.Back:
                            {
                                Back.RaiseClickEvent();
                                break;
                            }

                            case ButtonType.Down:
                            {
                                Down.RaiseClickEvent();
                                break;
                            }

                            case ButtonType.Left:
                            {
                                Left.RaiseClickEvent();
                                break;
                            }

                            case ButtonType.Ok:
                            {
                                Ok.RaiseClickEvent();
                                break;
                            }

                            case ButtonType.Right:
                            {
                                Right.RaiseClickEvent();
                                break;
                            }

                            case ButtonType.Up:
                            {
                                Up.RaiseClickEvent();
                                break;
                            }
                            }
                        }
                    }
                }
            }
            _eventButtons = null;
        }