Esempio n. 1
0
        private void btn_AddAttachment_Click(object sender, EventArgs e)
        {
            //OOBInfo

            OOBInfo oobInfo = new OOBInfo();

            this.lastOobID++;
            oobInfo.id = lastOobID;
            if (acNum == 0)
            {
                oobInfo.name = this.txt_BasicName.Text.Trim();
            }
            string       basicTypeName = (string)cbb_BasicType.SelectedItem;//获取当前选中项
            ArmyTypeEnum armyTypeEnum  = ConvertArmyTypeStringToEnum(basicTypeName);

            if (armyTypeEnum.Equals(ArmyTypeEnum.Navy))
            {
                oobInfo.type = "destroyer";
            }
            else if (armyTypeEnum.Equals(ArmyTypeEnum.Air))
            {
                oobInfo.type = "interceptor";
            }
            else
            {
                oobInfo.type = "hq_brigade";
            }

            ShowUserControl(oobInfo);
            acNum++;
        }
Esempio n. 2
0
 private void BindCbb_BasicType()
 {
     if (armyType.Equals(ArmyTypeEnum.Theatre))
     {
         cbb_BasicType.Items.Add(ArmyTypeEnum.ArmyGroup.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Army.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Corps.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Division.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Navy.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Air.ToString());
     }
     if (armyType.Equals(ArmyTypeEnum.ArmyGroup))
     {
         cbb_BasicType.Items.Add(ArmyTypeEnum.Army.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Corps.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Division.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Navy.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Air.ToString());
     }
     if (armyType.Equals(ArmyTypeEnum.Army))
     {
         cbb_BasicType.Items.Add(ArmyTypeEnum.Corps.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Division.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Navy.ToString());
         cbb_BasicType.Items.Add(ArmyTypeEnum.Air.ToString());
     }
     if (armyType.Equals(ArmyTypeEnum.Corps))
     {
         this.cb_Reserve.Enabled = true;
         cbb_BasicType.Items.Add(ArmyTypeEnum.Division.ToString());
     }
 }