private void SetupBindingCombos() { if (Properties.Settings.Default.XboxCustomMapping && MapsView.SelectedItems.Count > 0) { ControlBinding binding = (ControlBinding)MapsView.SelectedItems[0].Tag; MapsView.EndUpdate(); TargetTypeCombo.Items.Clear(); TargetTypeCombo.Items.AddRange(UiTools.GetBindingTargetTypeList()); TargetTypeCombo.SelectedIndex = (int)binding.TargetType; BindTypeCombo.Items.Clear(); BindTypeCombo.Items.AddRange(Enum.GetNames(typeof(BindingType))); BindTypeCombo.SelectedIndex = (int)binding.BindingType; RepeatCheckbox.Checked = binding.Parent.AutoRepeat; UpdatePropertyCombo(); } else { TargetTypeCombo.Items.Clear(); BindTypeCombo.Items.Clear(); TargetPropertyCombo.Items.Clear(); } }
private void LoadControlMaps() { MidiMap map = (MidiMap)DeviceList.SelectedItem; MapsView.BeginUpdate(); MapsView.Items.Clear(); foreach (ControlMap cm in map.ControlMaps) { ListViewItem item = new ListViewItem(cm.Name); item.Tag = cm.BindingA; cm.BindingA.Parent = cm; item.SubItems.Add(cm.Channel.ToString()); item.SubItems.Add(cm.ID.ToString()); item.SubItems.Add(cm.BindingA.HadnlerType.ToString()); item.SubItems.Add(cm.BindingA.ToString()); MapsView.Items.Add(item); if (cm.BindingB.HadnlerType != HandlerType.None) { item = new ListViewItem(cm.Name); item.Tag = cm.BindingB; cm.BindingB.Parent = cm; item.SubItems.Add(cm.Channel.ToString()); item.SubItems.Add(cm.ID.ToString()); item.SubItems.Add(cm.BindingB.HadnlerType.ToString()); item.SubItems.Add(cm.BindingB.ToString()); MapsView.Items.Add(item); } } MapsView.EndUpdate(); }
void SetupMapList() { if (Properties.Settings.Default.XboxModeMapping) { if (ModeCombo.SelectedIndex == -1) { ModeCombo.SelectedIndex = 0; } selectedMode = ModeCombo.SelectedIndex; } else { selectedMode = 6; } MapsView.BeginUpdate(); MapsView.Items.Clear(); ignoreChanges++; foreach (ControlMap cm in xboxMaps[selectedMode].ControlMaps) { ListViewItem item = new ListViewItem(cm.Name); item.Tag = cm.BindingA; cm.BindingA.Parent = cm; item.SubItems.Add(cm.BindingA.ToString()); item.SubItems.Add(cm.AutoRepeat ? "Repeat" : "Once"); MapsView.Items.Add(item); item.Selected = true; } ignoreChanges--; MapsView.EndUpdate(); }