private void btnOk_Click(object sender, EventArgs e) { Groups.Clear(); Locations.Clear(); Flags.Clear(); OverwriteChance = chkOverwriteChance.Checked; EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value); foreach (object o in lstGroups.SelectedItems) { EncounterZoneGroup group = new EncounterZoneGroup(); group.Name = o.ToString(); group.Quantity = Decimal.ToInt32(numEncounterQuantity.Value); Groups.Add(group); } foreach (object o in lstLocations.SelectedItems) { EncounterZoneLocation location = new EncounterZoneLocation(); location.Name = o.ToString(); Locations.Add(location); } foreach (object o in lstFlags.SelectedItems) { string flag; flag = o.ToString(); Flags.Add(flag); } Cancelled = false; this.Close(); }
private void btnAdd_Click(object sender, EventArgs e) { ArrayList SGroups = (ArrayList)lstGroups.SelectedObjects; SGroups.Cast<EncounterGroup>(); foreach (EncounterGroup group in SGroups.ToArray()) { EncounterZoneGroup NewGroup = new EncounterZoneGroup(); NewGroup.Name = group.Name; NewGroup.Quantity = Decimal.ToInt32(numEncounterQuantity.Value); SelectedGroups.Add(NewGroup); } EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value); this.Close(); }
private void lstGroups_MouseDoubleClick(object sender, MouseEventArgs e) { EncounterZoneGroup group = (EncounterZoneGroup)lstGroups.SelectedObject; if (group == null) { return; } frmEditGroup EditGroup = new frmEditGroup(); EditGroup.group = group; EditGroup.ShowDialog(); RefreshGroupList(); }
private void btnAdd_Click(object sender, EventArgs e) { ArrayList SGroups = (ArrayList)lstGroups.SelectedObjects; SGroups.Cast <EncounterGroup>(); foreach (EncounterGroup group in SGroups.ToArray()) { EncounterZoneGroup NewGroup = new EncounterZoneGroup(); NewGroup.Name = group.Name; NewGroup.Quantity = Decimal.ToInt32(numEncounterQuantity.Value); SelectedGroups.Add(NewGroup); } EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value); this.Close(); }
private List <EncounterZoneGroup> ParseGroups(String[] Groups, EncounterGroupParser GroupParser, string Pos) { List <EncounterZoneGroup> Grps = new List <EncounterZoneGroup>(); if (Groups.Length > 1 || Groups[0] != "") { foreach (string i in Groups) { if (i.Length < 5 || i.Substring(0, 5) != "GROUP") { Message.Show("Invalid group " + i + " at " + Pos + ".", MessageBoxButtons.OK, MessageBoxIcon.Error); } String[] toks = i.Split(':'); EncounterZoneGroup group = new EncounterZoneGroup(toks[0], Int32.Parse(toks[1]), GroupParser.GetGroupByName(toks[0])); Grps.Add(group); } } return(Grps); }
private List<EncounterZoneGroup> ParseGroups(String[] Groups, EncounterGroupParser GroupParser, string Pos) { List<EncounterZoneGroup> Grps = new List<EncounterZoneGroup>(); if (Groups.Length > 1 || Groups[0] != "") foreach (string i in Groups) { if (i.Length < 5 || i.Substring(0, 5) != "GROUP") Message.Show("Invalid group " + i + " at " + Pos + ".", MessageBoxButtons.OK, MessageBoxIcon.Error); String[] toks = i.Split(':'); EncounterZoneGroup group = new EncounterZoneGroup(toks[0], Int32.Parse(toks[1]), GroupParser.GetGroupByName(toks[0])); Grps.Add(group); } return Grps; }