Exemplo n.º 1
0
        private void addSpecialEquip(SpecialEquipInfo equipInfo)
        {
            this.controller.AddSpecialEquip(equipInfo);

            var itemView = new ShipEquipmentItem();

            itemView.Data = new ShipComponentType <SpecialEquipInfo>(
                equipInfo.Name, ImageCache.Get[equipInfo.ImagePath], equipInfo,
                equipmentAction.Dispatch
                );
            itemView.Amount = this.controller.SpecialEquipCount(equipInfo);

            if (equipmentSeparator == null)
            {
                this.equipmentSeparator           = new Label();
                this.equipmentSeparator.Anchor    = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                this.equipmentSeparator.Size      = new System.Drawing.Size(375, 25);
                this.equipmentSeparator.Text      = LocalizationManifest.Get.CurrentLanguage["FormDesign"]["specEquipSeparator"].Text();
                this.equipmentSeparator.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                this.equipmentList.Controls.Add(this.equipmentSeparator);
                this.equipmentList.Unselectable(this.equipmentSeparator);
            }

            this.equipmentList.Controls.Add(itemView);
            this.equipmentList.SelectedIndex = equipmentList.Controls.Count - 1;
        }
Exemplo n.º 2
0
        private void addMissionEquip(MissionEquipInfo equipInfo)
        {
            int index = (equipmentSeparator == null) ?
                        this.equipmentList.Controls.Count :
                        this.equipmentList.Controls.IndexOf(equipmentSeparator);

            this.controller.AddMissionEquip(equipInfo);

            var itemView = new ShipEquipmentItem();

            itemView.Data = new ShipComponentType <MissionEquipInfo>(
                equipInfo.Name, ImageCache.Get[equipInfo.ImagePath], equipInfo,
                equipmentAction.Dispatch
                );
            itemView.Amount = this.controller.MissionEquipCount(index);

            this.equipmentList.Controls.Add(itemView);
            this.equipmentList.SelectedIndex = ControlListView.NoneSelected;
            this.equipmentList.Controls.SetChildIndex(itemView, index);
            this.equipmentList.SelectedIndex = index;
        }