示例#1
0
 // Boss Selector
 private void CB_BL_FilterType_SelectedIndexChanged(object sender, SelectionChangedEventArgs e)
 {
     try {
         if (!isLoading)
         {
             isLoading = true;
             // Use Filter Type Box to adjust Filter Box
             if (CB_BL_Filter.Items.Count > 0)
             {
                 CB_BL_Filter.Items.Clear();
             }
             if (CB_BL_Filter.Items.Count < 1)
             {
                 CB_BL_Filter.Items.Add("All");
             }
             CB_BL_Filter.SelectedItem = "All";
             BossList.FilterType ftype = (BossList.FilterType)(CB_BL_FilterType.SelectedIndex);
             bosslist.GenCalledList(ftype, CB_BL_Filter.SelectedItem.ToString());
             foreach (string s in bosslist.GetFilterListAsArray(ftype))
             {
                 CB_BL_Filter.Items.Add(s);
             }
             CB_BL_Filter.SelectedItem = "All";
             // Now edit the Boss List to the new filtered list of bosses
             if (CB_BossList.Items.Count > 0)
             {
                 CB_BossList.Items.Clear();
             }
             CB_BossList.Items.Add("Custom");
             foreach (string s in bosslist.GetBetterBossNamesAsArray())
             {
                 CB_BossList.Items.Add(s);
             }
             CB_BossList.SelectedItem = "Custom";
             // Save the new names
             if (!firstload)
             {
                 BossOptions.FilterType = (BossList.FilterType)((ComboBoxItem)(CB_BL_FilterType.SelectedItem)).Content;
                 BossOptions.Filter     = CB_BL_Filter.SelectedItem.ToString();
                 BossOptions.BossName   = CB_BossList.SelectedItem.ToString();
             }
             //
             Character.OnCalculationsInvalidated();
             isLoading = false;
         }
     }catch (Exception ex) {
         new Base.ErrorBox()
         {
             Title        = "Error in the Boss Options",
             Function     = "CB_BL_FilterType_SelectedIndexChanged()",
             TheException = ex,
         }.Show();
         isLoading = false;
     }
 }
示例#2
0
 private void CB_BL_Filter_SelectedIndexChanged(object sender, SelectionChangedEventArgs e)
 {
     try {
         if (!isLoading)
         {
             isLoading = true;
             // Use Filter Type Box to adjust Filter Box
             BossList.FilterType ftype = (BossList.FilterType)(CB_BL_FilterType.SelectedIndex);
             //ComboBoxItem a = (ComboBoxItem)CB_BL_Filter.SelectedItem;
             bosslist.GenCalledList(ftype, CB_BL_Filter.SelectedItem.ToString());//a.Content.ToString());
             // Now edit the Boss List to the new filtered list of bosses
             if (CB_BossList.Items.Count > 0)
             {
                 CB_BossList.Items.Clear();
             }
             CB_BossList.Items.Add("Custom");
             foreach (string s in bosslist.GetBetterBossNamesAsArray())
             {
                 CB_BossList.Items.Add(s);
             }
             CB_BossList.SelectedItem = "Custom";
             // Save the new names
             if (!firstload)
             {
                 BossOptions.FilterType = (BossList.FilterType)CB_BL_FilterType.SelectedIndex;
                 BossOptions.Filter     = CB_BL_Filter.SelectedItem.ToString();
                 BossOptions.BossName   = CB_BossList.SelectedItem.ToString();
             }
             //
             Character.OnCalculationsInvalidated();
             isLoading = false;
         }
     }catch (Exception ex) {
         new ErrorBox("Error in the Boss Options",
                      ex.Message, "CB_BL_Filter_SelectedIndexChanged()",
                      "No Additional Info", ex.StackTrace);
         isLoading = false;
     }
 }