private void packToolStripMenuItem_Click(object sender, EventArgs e) { if (ItemCat.SelectedItem == null) { return; } Pack i = new Pack() { Source = Program.Context.Config.DefaultSource, Category = ImportExtensions.Make(Program.Context, (string)ItemCat.SelectedItem) }; PackForm r = new PackForm(i); r.Saved += ItemSaved; r.Show(); }
private void ItemCats_SelectedIndexChanged(object sender, EventArgs e) { string cat = (string)ItemCat.SelectedItem; ItemBox.Items.Clear(); NewItemCat.Enabled = false; NewItem.Enabled = false; if (cat != null) { NewItemCat.Enabled = true; NewItem.Enabled = true; Category category = ImportExtensions.Make(Program.Context, cat); foreach (Item i in from i in Program.Context.Items.Values where category.Equals(i.Category) orderby i.Name select i) { ItemBox.Items.Add(i); } } }