public override void Dispose() { if (!disposed) { Application.Idle -= IdleHandler; disposed = true; // objectBrowser.Dispose(); // objectBrowser = null; } instance = null; base.Dispose(); }
public override void Run() { // Switch to previously opened view. foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection) { ComponentInspectorView openView = viewContent as ComponentInspectorView; if (openView != null) { openView.WorkbenchWindow.SelectWindow(); return; } } // Create new view. ComponentInspectorView view = new ComponentInspectorView(); WorkbenchSingleton.Workbench.ShowView(view); }
public ComponentInspectorView() { instance = this; SetLocalizedTitle("${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}"); // HACK: Due to various static members in the ComponentInspector // the ObjectBrowser does not like being re-used after being disposed. // Workaround this by keeping a reference to the ObjectBrowser. if (objectBrowser == null) { objectBrowser = new ObjectBrowser(showStatusPanel, tabbedLayout); } AssemblySupport.AddCurrentAssemblies(); ComSupport.RestoreComEnvironment(); AssemblySupport.RestoreAssemblies(); Application.Idle += IdleHandler; }