void SolidEdgeFramework.ISolidEdgeAddIn.OnConnection(object Application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance) { if (IsDefaultAppDomain) { _application = (SolidEdgeFramework.Application)Application; _addInInstance = AddInInstance; // Notice that "\n" is prepended to the description. This allows the addin to have its own Ribbon Tabs. this.AddInEx.Description = String.Format("\n{0}", this.AddInEx.Description); InitializeIsolatedAddIn(); if (_isolatedAddIn != null) { // Forward call to isolated AppDomain. _isolatedAddIn.OnConnection(_application, ConnectMode, AddInInstance); } } else { Application = UnwrapTransparentProxy(Application); AddInInstance = UnwrapTransparentProxy <SolidEdgeFramework.AddIn>(AddInInstance); _instance = this; _application = (SolidEdgeFramework.Application)Application; _addInInstance = AddInInstance; _ribbonController = new RibbonController(this); _edgeBarController = new EdgeBarController(this); _viewOverlayController = new ViewOverlayController(); OnConnection(_application, ConnectMode, AddInInstance); } }
void SolidEdgeFramework.ISolidEdgeAddIn.OnDisconnection(SolidEdgeFramework.SeDisconnectMode DisconnectMode) { if (IsDefaultAppDomain) { if (_isolatedAddIn != null) { // Forward call to isolated AppDomain. _isolatedAddIn.OnDisconnection(DisconnectMode); // Unload isolated domain. if (_isolatedDomain != null) { AppDomain.Unload(_isolatedDomain); } _isolatedDomain = null; _isolatedAddIn = null; } } else { OnDisconnection(DisconnectMode); if (_ribbonController != null) { try { _ribbonController.Dispose(); } catch { } _ribbonController = null; } if (_edgeBarController != null) { try { _edgeBarController.Dispose(); } catch { } _edgeBarController = null; } if (_viewOverlayController != null) { try { _viewOverlayController.Dispose(); } catch { } _viewOverlayController = null; } } }
///// <summary> ///// Called during SolidEdgeFramework.ISEAddInEdgeBarEventsEx.AddPage() event. ///// </summary> ///// <param name="controller"></param> ///// <remarks> ///// Use this override for creating EdgeBar pages that are not document specific. ///// </remarks> //public virtual void OnCreateEdgeBarPage(EdgeBarController controller) //{ //} /// <summary> /// Called during SolidEdgeFramework.ISEAddInEdgeBarEventsEx.AddPage() event. /// </summary> /// <param name="controller"></param> /// <param name="document"></param> /// <remarks> /// Use this override for creating EdgeBar pages that are document specific. /// </remarks> public virtual void OnCreateEdgeBarPage(EdgeBarController controller, SolidEdgeFramework.SolidEdgeDocument document) { }