Exemplo n.º 1
0
        private void FillComboboxes(Loadout_Line line)
        {
            IEnumerable <Weapon> ieW = Weapon.GetAll();

            foreach (Weapon ob in ieW)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cbWeapon.Items.Add(cbI);
                if (line.weaponID == ob.id)
                {
                    cbWeapon.SelectedItem = cbI;
                }
            }
            IEnumerable <Ammunition> ieA = Ammunition.GetAll();

            foreach (Ammunition ob in ieA)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cbAmmunition.Items.Add(cbI);
                if (line.ammunitionID == ob.id)
                {
                    cbAmmunition.SelectedItem = cbI;
                }
            }
        }
Exemplo n.º 2
0
        private void Load_LoadOut()
        {
            IEnumerable <Loadout_Line> lines = Loadout_Line.getAll();

            foreach (Loadout_Line line in lines)
            {
                spWeapons.Children.Add(new LoadOutWeaponLine(line));
            }
        }
Exemplo n.º 3
0
        public Loadout_Line GetLoadout_Line()
        {
            Loadout_Line line = new Loadout_Line();
            ComboBoxItem cbI  = (ComboBoxItem)cbWeapon.SelectedItem;

            line.weaponID     = (int)cbI.Tag;
            cbI               = (ComboBoxItem)cbAmmunition.SelectedItem;
            line.ammunitionID = (int)cbI.Tag;
            return(line);
        }
Exemplo n.º 4
0
        private void FillComboboxes()
        {
            IEnumerable <Loadout_Line> loadout_lines = Loadout_Line.getAll();

            foreach (Loadout_Line line in loadout_lines)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = Weapon.GetNameFromID(line.weaponID);
                cbI.Tag     = line.weaponID;
                cb_Weapon.Items.Add(cbI);
            }
        }
Exemplo n.º 5
0
 public static void CreateSystemTables()
 {
     Ammunition.CreateTable();
     Difficulty.CreateTable();
     Fur.CreateTable();
     Lang_String.CreateTable();
     Sex.CreateTable();
     Species.CreateTable();
     Trophy.CreateTable();
     TrophyKind.CreateTable();
     TrophyOrgane.CreateTable();
     TrueScore.CreateTable();
     Weapon.CreateTable();
     Map.CreateTable();
     Loadout_Line.CreateTable();
     theHunterLog.Database.ObjectClasses.Version.CreateTable();
 }
Exemplo n.º 6
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Loadout_Line.Truncate();
         foreach (UIElement element in spWeapons.Children)
         {
             LoadOutWeaponLine line = (LoadOutWeaponLine)element;
             line.GetLoadout_Line().Insert();
         }
         this.Close();
     }
     catch
     {
         String           msg    = Main.lang.warning_Save_Log;
         MessageBoxResult result = MessageBox.Show(msg, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Exemplo n.º 7
0
 public LoadOutWeaponLine(Loadout_Line line)
 {
     InitializeComponent();
     FillComboboxes(line);
 }