public static ObjectChooser CreateObjectChooser(MainForm.DoWaitCallback doWaitCB, MainForm.StopWaitCallback stopWaitCB, MainForm.updateProgressCallback updateProgressCB, MainForm.listViewAddCallBack listViewAddCB, CatalogType resourceType, EventHandler<MainForm.SelectedIndexChangedEventArgs> selectedIndexChangedHandler, EventHandler<MainForm.ItemActivateEventArgs> itemActivateHandler) { ObjectChooser res; if (!objectChooserCache.ContainsKey(resourceType)) { res = new ObjectChooser(doWaitCB, stopWaitCB, updateProgressCB, listViewAddCB, resourceType); res.SelectedIndexChanged += selectedIndexChangedHandler; res.ItemActivate += itemActivateHandler; return res; } res = objectChooserCache[resourceType]; res.SelectedIndexChanged = null; res.SelectedItem = null; res.listView1.SelectedItems.Clear(); res.SelectedIndexChanged += selectedIndexChangedHandler; res.ItemActivate = null; res.ItemActivate += itemActivateHandler; return res; }
public static ObjectChooser CreateObjectChooser(MainForm.DoWaitCallback doWaitCB, MainForm.StopWaitCallback stopWaitCB, MainForm.updateProgressCallback updateProgressCB, MainForm.listViewAddCallBack listViewAddCB, CatalogType resourceType, EventHandler <MainForm.SelectedIndexChangedEventArgs> selectedIndexChangedHandler, EventHandler <MainForm.ItemActivateEventArgs> itemActivateHandler) { ObjectChooser res; if (!objectChooserCache.ContainsKey(resourceType)) { res = new ObjectChooser(doWaitCB, stopWaitCB, updateProgressCB, listViewAddCB, resourceType); res.SelectedIndexChanged += selectedIndexChangedHandler; res.ItemActivate += itemActivateHandler; return(res); } res = objectChooserCache[resourceType]; res.SelectedIndexChanged = null; res.SelectedItem = null; res.listView1.SelectedItems.Clear(); res.SelectedIndexChanged += selectedIndexChangedHandler; res.ItemActivate = null; res.ItemActivate += itemActivateHandler; return(res); }