/// <summary>
        /// Called when the add-in has disconnected from SolidWorks
        /// </summary>
        public void DisconnectedFromSolidWorks()
        {
            AddInIntegration.OnDisconnectedFromSolidWorks();

            // Inform plug-ins
            mPlugIns.ForEach(plugin => plugin.DisconnetedFromSolidWorks());
        }
        /// <summary>
        /// Called when the add-in has connected to SolidWorks
        /// </summary>
        public void ConnectedToSolidWorks()
        {
            AddInIntegration.OnConnectedToSolidWorks();

            // Inform plug-ins
            mPlugIns.ForEach(plugin => plugin.ConnectedToSolidWorks());
        }
Пример #3
0
        /// <summary>
        /// Called when the add-in has disconnected from SolidWorks
        /// </summary>
        public static void DisconnectedFromSolidWorks()
        {
            if (UseDetachedAppDomain)
            {
                CrossDomain.DisconnectedFromSolidWorks();
            }
            else
            {
                AddInIntegration.OnDisconnectedFromSolidWorks();

                // Inform plug-ins
                PlugIns.ForEach(plugin => plugin.DisconnectedFromSolidWorks());
            }
        }
Пример #4
0
        /// <summary>
        /// Called when the add-in has disconnected from SolidWorks
        /// </summary>
        public static void DisconnectedFromSolidWorks()
        {
            if (UseDetachedAppDomain)
            {
                CrossDomain.DisconnectedFromSolidWorks();
            }
            else
            {
                AddInIntegration.OnDisconnectedFromSolidWorks();

                // Inform plug-ins
                PlugIns.ForEach(plugin =>
                {
                    // Log it
                    Logger.LogDebugSource($"Firing DisconnectedFromSolidWorks event for plugin `{plugin.AddInTitle}`...");

                    plugin.DisconnectedFromSolidWorks();
                });
            }
        }
        /// <summary>
        /// Cleans up the plug-in app domain so that the plug-in dll files can be edited after unloading
        /// </summary>
        public static void Teardown()
        {
            // Run code on new app-domain to tear down
            if (UseDetachedAppDomain)
            {
                // Tear down
                PluginCrossDomain.Teardown();

                // Log it
                Logger.LogDebugSource($"Unloading cross-domain...");

                // Unload our domain
                AppDomain.Unload(PlugInAppDomain);
            }
            else
            {
                // Tear down SolidWorks references
                AddInIntegration.TearDown();
            }
        }