protected void OnAtoGroupComboChanged(object sender, ComboBoxChangedEventArgs e) { if (e.activeText == "New ATO...") { var parent = Toplevel as Window; var s = new AtoSettings(new AutoTopOffGroupSettings(), parent); s.Run(); var newGroupName = s.groupName; var outcome = s.outcome; if (outcome == TouchSettingsOutcome.Added) { atoGroupCombo.comboList.Insert(atoGroupCombo.comboList.Count - 1, newGroupName); atoGroupCombo.activeText = newGroupName; atoGroupName = newGroupName; } else { atoGroupCombo.activeText = atoGroupName; } } else { atoGroupName = e.activeText; } GetAtoGroupData(); }
protected void OnAtoSettingsButtonReleaseEvent(object sender, ButtonReleaseEventArgs args) { var parent = Toplevel as Window; var s = new AtoSettings(AutoTopOff.GetAutoTopOffGroupSettings(atoGroupName), parent); s.Run(); var newAtoGroupName = s.groupName; var outcome = s.outcome; if ((outcome == TouchSettingsOutcome.Modified) && (newAtoGroupName != groupName)) { var index = atoGroupCombo.comboList.IndexOf(groupName); atoGroupCombo.comboList[index] = newAtoGroupName; atoGroupName = newAtoGroupName; } else if (outcome == TouchSettingsOutcome.Added) { atoGroupCombo.comboList.Insert(atoGroupCombo.comboList.Count - 1, newAtoGroupName); atoGroupCombo.activeText = newAtoGroupName; atoGroupName = newAtoGroupName; } else if (outcome == TouchSettingsOutcome.Deleted) { atoGroupCombo.comboList.Remove(atoGroupName); atoGroupName = AutoTopOff.firstAtoGroup; if (atoGroupName.IsNotEmpty()) { atoGroupCombo.activeText = atoGroupName; } else { atoGroupCombo.activeIndex = -1; } } atoGroupCombo.QueueDraw(); GetAtoGroupData(); }