public SaveBuffSetDialog(List <Buff> newBuffSet) { InitializeComponent(); BuffSet = newBuffSet; SavedBuffSetList saved = SavedBuffSet.AllSets; if (saved.Count > 0) { UpdateCombo.ItemsSource = saved; UpdateCombo.SelectedIndex = 0; } else { UpdateCombo.IsEnabled = false; } }
public SaveBuffSetDialog(List <Buff> newBuffSet) { InitializeComponent(); #if !SILVERLIGHT this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; this.WindowState = System.Windows.WindowState.Normal; #endif BuffSet = newBuffSet; SavedBuffSetList saved = SavedBuffSet.AllSets; if (saved.Count > 0) { UpdateCombo.ItemsSource = saved; UpdateCombo.SelectedIndex = 0; } else { UpdateCombo.IsEnabled = false; } }
private void UpdateSavedSets() { SavedBuffSetList savedSets = SavedBuffSet.AllSets; SavedBuffSet current = null; updating = true; foreach (SavedBuffSet sbs in savedSets) { if (sbs.Equals(Character.ActiveBuffs)) { current = sbs; break; } } if (current != null) { HasCustomSets = false; SavedCombo.ItemsSource = savedSets; SavedCombo.SelectedItem = current; SaveDeleteButton.Content = "Delete"; } else { HasCustomSets = true; current = new SavedBuffSet("Custom", Character.ActiveBuffs); SavedBuffSetList currentList = new SavedBuffSetList(); currentList.AddRange(savedSets); currentList.Add(current); SavedCombo.ItemsSource = null; SavedCombo.ItemsSource = currentList; SavedCombo.SelectedItem = current; SaveDeleteButton.Content = "Save"; } updating = false; }