Example #1
0
        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;
        }
        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;
        }