private void DeleteControlScheme() { if (!this.ParentWindow.SelectedConfig.ControlSchemesDict.ContainsKey(this.mSchemeName.Text) || this.ParentWindow.SelectedConfig.ControlSchemesDict[this.mSchemeName.Text].BuiltIn) { return; } if (this.ParentWindow.SelectedConfig.ControlSchemesDict[this.mSchemeName.Text].Selected) { this.ParentWindow.SelectedConfig.ControlSchemesDict[this.mSchemeName.Text].Selected = false; if (this.ParentWindow.SelectedConfig.ControlSchemes.Count > 1) { this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem = !(this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem == (this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children[0] as ComboBoxSchemeControl).mSchemeName.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture)) ? (this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children[0] as ComboBoxSchemeControl).mSchemeName.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture) : (this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children[1] as ComboBoxSchemeControl).mSchemeName.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture); this.ParentWindow.SelectedConfig.ControlSchemesDict[this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem].Selected = true; this.CanvasWindow.SidebarWindow.mSchemeComboBox.mName.Text = this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem; this.ParentWindow.SelectedConfig.SelectedControlScheme = this.ParentWindow.SelectedConfig.ControlSchemesDict[this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem]; this.CanvasWindow.SidebarWindow.ProfileChanged(); } else { this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem = (string)null; BlueStacksUIBinding.Bind(this.CanvasWindow.SidebarWindow.mSchemeComboBox.mName, "Custom", ""); } } this.ParentWindow.SelectedConfig.ControlSchemes.Remove(this.ParentWindow.SelectedConfig.ControlSchemesDict[this.mSchemeName.Text]); this.ParentWindow.SelectedConfig.ControlSchemesDict.Remove(this.mSchemeName.Text); ComboBoxSchemeControl schemeControlFromName = KMManager.GetComboBoxSchemeControlFromName(this.mSchemeName.Text); if (schemeControlFromName != null) { this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children.Remove((UIElement)schemeControlFromName); } KeymapCanvasWindow.sIsDirty = true; this.CanvasWindow.SidebarWindow.FillProfileCombo(); if (this.ParentWindow.SelectedConfig.ControlSchemes.Count != 0) { return; } this.CanvasWindow.ClearWindow(); }