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; } } }
private void Load_LoadOut() { IEnumerable <Loadout_Line> lines = Loadout_Line.getAll(); foreach (Loadout_Line line in lines) { spWeapons.Children.Add(new LoadOutWeaponLine(line)); } }
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); }
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); } }
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(); }
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); } }
public LoadOutWeaponLine(Loadout_Line line) { InitializeComponent(); FillComboboxes(line); }