예제 #1
0
        private void FillPanels(JoystickConfig joystickInfo)
        {
            foreach (var control in joystickInfo.Controls)
            {
                BaseControlPanel panel;

                if (control is JoystickAxle)
                {
                    panel = new AxlePanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is ButtonsCollection)
                {
                    panel = new ButtonsPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is HatSwitch)
                {
                    panel = new HatPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is LevelingBits)
                {
                    panel = new DummyPanel();
                    panel.FillFromJoyInfo(control);
                }
                else
                {
                    continue;
                }

                AddPanel(panel);
            }

            tbName.Text  = joystickInfo.Name;
            tbCName.Text = joystickInfo.Code;
        }
예제 #2
0
        private void FillPanels(JoystickConfig joystickInfo)
        {
            foreach (var control in joystickInfo.Controls)
            {
                BaseControlPanel panel;

                if (control is JoystickAxle)
                {
                    panel = new AxlePanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is ButtonsCollection)
                {
                    panel = new ButtonsPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is HatSwitch)
                {
                    panel = new HatPanel();
                    panel.FillFromJoyInfo(control);
                }
                else if (control is LevelingBits)
                {
                    panel = new DummyPanel();
                    panel.FillFromJoyInfo(control);
                }
                else
                {
                    continue;
                }

                AddPanel(panel);
            }

            tbName.Text          = joystickInfo.Name;
            tbVendorProduct.Text = string.Format("{0:X4}:{1:X4}", joystickInfo.VendorID, joystickInfo.ProductID);
        }