Exemplo n.º 1
0
        void IRtdServer.ServerTerminate()
        {
            try
            {
                // The Unregister call here just tells the reg-free loading that we are gone,
                // to ensure a fresh load with new 'fake progid' next time.
                // Also safe to call (basically a no-op) if we are not loaded via reg-free, but via real COM Server.
                RtdRegistration.UnregisterRTDServer(RegisteredProgId);

                if (_updateSync != null)
                {
                    _updateSync.DeregisterUpdateNotify(_callbackObject);
                }

                using (XlCall.Suspend())
                {
                    ServerTerminate();
                }
            }
            catch (Exception e)
            {
                Logging.LogDisplay.WriteLine("Error in RTD server {0} ServerTerminate: {1}", GetType().Name, e.ToString());
            }
        }