public static void Show( SortableBindingList <SearchHit> data, App.SetElementId set_id, JtWindowHandle h) { if (null == _singleton_instance) { _singleton_instance = new SearchHitNavigator( data, set_id); _singleton_instance.Load += new EventHandler(OnLoad); _singleton_instance.FormClosing += new FormClosingEventHandler( OnFormClosing); _singleton_instance.FormClosing += new FormClosingEventHandler( OnFormClosing); _singleton_instance.Disposed += new EventHandler(OnDisposed); _singleton_instance.Show(h); } else { _singleton_instance.dataGridView1.DataSource = data; } }
public Result OnShutdown(UIControlledApplication a) { SearchHitNavigator.Shutdown(); Unsubscribe(); return(Result.Succeeded); }
/// <summary> /// Display a modeless dialogue with entries for all search hits. /// Pass in the Revit application window handle and a delegate /// method allowing the dialogue to pass back a pending element /// id, which will be an element that the user wishes to zoom to. /// Subscribe to the Idling event. /// The modeless dialogue passes back the pending element id. /// In the event handler, the pending element id is picked up /// and displayed to the user on the Revit graphics screen. /// </summary> public static void ShowForm( SortableBindingList <SearchHit> data) { SearchHitNavigator.Show(data, new SetElementId(SetPendingElementId), _hWndRevit); Subscribe(); }
static void OnDisposed( object sender, EventArgs e) { _singleton_instance = null; }