public void ServerTerminate() { try { using (XlCall.Suspend()) { RtdRegistration.UnregisterRTDServer(_progId); if (_rtdServer != null) { _rtdServer.ServerTerminate(); return; } _ServerTerminate(); } } catch (Exception e) { Logger.RtdServer.Error("Error in RTD server {0} ServerTerminate: {1}", _progId, e.ToString()); } }
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()); } }