Ejemplo n.º 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();
            }
        }