Exemplo n.º 1
0
 private void PAConfirmAdd_Click(object sender, EventArgs e)
 {
     if (PAItemList.SelectedIndex == -1)
     {
         int ConfirmIndex = PAListBoxResults.SelectedIndex;
         PAItemList.SelectedItem        = SelectedItem;
         PAListBoxResults.SelectedIndex = ConfirmIndex;
     }
     if (PAListBoxResults.SelectedIndex == -1)
     {
         string ItemName = PAItemList.SelectedItem.ToString();
         _ = MessageBox.Show($"Please select the character getting {ItemName.Substring(0, ItemName.LastIndexOf('('))} and try again.",
                             "No Character Selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (PAListBoxResults.SelectedItem is ResultsBoxItem boxItem)
     {
         // int CharIndex = ServerMates.IndexOf(ServerMates.Find(p => p.DaybreakID == boxItem.CharID));
         if (!ServerMates[boxItem.CharID].CharCollection.ContainsKey(boxItem.QuestID))
         {
             ServerMates[boxItem.CharID].CharCollection[boxItem.QuestID] = new List <long>();
         }
         ServerMates[boxItem.CharID].CharCollection[boxItem.QuestID].Add((PAItemList.SelectedItem as ItemsFormat).ItemID);
         PAItemList.SelectedIndex = -1;
         Confirm_Cull(PAListBoxResults.SelectedItem as ResultsBoxItem);
         PAListBoxResults.Items.Clear();
         PAIntroLabel.Text = string.Empty;
         _ = PAItemList.Focus();
         if (FinalResult == DialogResult.Cancel)
         {
             FinalResult = DialogResult.OK;
         }
     }
 }
Exemplo n.º 2
0
 private void PAResetBtn_Click(object sender, EventArgs e)
 {
     Refresh();
     PAItemList.SelectedIndex = -1;
     PAIntroLabel.Text        = string.Empty;
     PAListBoxResults.Items.Clear();
     SelectedItem = null;
     _            = PAItemList.Focus();
 }