private void AddHat(HatSwitch control, int idx) { var panel = new HatPanel(); panel.SetInfo(control, idx); AddPanel(panel); RegiseterLink(panel.GetLink()); }
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; }
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); }