示例#1
0
        /// <summary>
        /// Repopulates selected objects info to the screen
        /// Should be refactored to handle changing other indexes with index changed events later
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ObjectList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ObjectList.SelectedIndices.Count > 0)
            {
                TempObject                = Objects[ObjectList.SelectedIndices[0]];
                PaidCheck.CheckState      = TempObject.Paid ? CheckState.Checked : CheckState.Unchecked;
                qtyNum.Value              = TempObject.Quantity;
                Focus_Combo.SelectedIndex = (int)TempObject.ActiveResource.Resource_ID;
                Type_Combo.SelectedIndex  = (int)TempObject.Object.ID - 1;

                Augment_List.SelectedItems.Clear();
                Name_Text.Text         = Objects[ObjectList.SelectedIndices[0]].Name;
                Notes_Text.Text        = Objects[ObjectList.SelectedIndices[0]].Notes;
                DaysComplete_Text.Text = Objects[ObjectList.SelectedIndices[0]].DaysComplete.ToString();

                foreach (Models.BaseRoom_Augmentation Augment in Objects[ObjectList.SelectedIndices[0]].Augmentations)
                {
                    Augment_List.SetSelected((Int32)Augment.Augment_ID - 1, true);
                }

                Object_Or_Augment_Changed(null, null);
            }
            else
            {
                New_Button.PerformClick();
            }
        }
示例#2
0
 /// <summary>
 /// Populates Augments into the augment list
 /// </summary>
 public void PopulateAugmentList()
 {
     Augment_List.DataSource    = BaseAugmentList();
     Augment_List.DisplayMember = "Info";
     Augment_List.ValueMember   = null;
     Augment_List.ClearSelected();
 }
示例#3
0
        /// <summary>
        /// Clears most of the screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void New_Button_Click(object sender, EventArgs e)
        {
            ObjectList.SelectedItems.Clear();
            Type_Combo.SelectedIndex = 0;
            Augment_List.ClearSelected();
            Focus_Combo.SelectedIndex = 0;
            PaidCheck.CheckState      = CheckState.Unchecked;
            qtyNum.Value = 1;

            Name_Text.Text         = "";
            Notes_Text.Text        = "";
            DaysComplete_Text.Text = "0";

            RespawnTempObject();
            TempObject.Object         = (Models.BaseObject)Type_Combo.SelectedValue;
            TempObject.Augmentations  = Augment_List.SelectedItems.OfType <Models.Base_Augmentation>().ToList();
            TempObject.ActiveResource = (Models.BaseResource)Focus_Combo.SelectedValue;
        }