public void AutoWire(ItemSource itemSource, IItemCollectionStore store, ItemConvertor itemConvertor) { this.store = store; this.itemConvertor = itemConvertor; this.treeView1.Nodes.Clear(); itemsNode = this.treeView1.Nodes.Add("folder:items", "Items"); foreach (var item in itemSource.GetItemDropdownData()) { itemsNode.Nodes.Add($"item:{item.Value}", item.Text).Tag = (ushort)item.Value; } this.collectionsNode = this.treeView1.Nodes.Add("folder:collections", "Collections"); collectionsNode.HideCheckBox(); RefreshCollections(); itemsNode.HideCheckBox(); itemsNode.HideCheckBox(); collectionsNode.HideCheckBox(); collectionsNode.Expand(); }
public static bool EditModal(IWin32Window owner, IItemCollectionStore store, ItemSource itemSource, ILifetimeScope scope) { using (CollectionEditorForm form = new CollectionEditorForm(store, itemSource, scope)) return(form.ShowDialog(owner) == DialogResult.OK); }