// Called internally from the AppDomain_DomainUnload event handler, and via the control function from another server when that server figures out that it must become the active server. internal static bool Deactivate() { try { if (_helper != null) { _helper.Dispose(); } _isActive = false; ClearActiveRegistrationInfo(); return(true); } catch (Exception /*ex*/) { // TODO: Log return(false); } }
// Called internally from the AppDomain_DomainUnload or AppDomain_ProcessExit event handler, and via the control function from another server when that server figures out that it must become the active server. internal static bool Deactivate() { try { if (_helper != null) { _helper.Dispose(); } _isActive = false; ClearActiveRegistrationInfo(); return(true); } catch (Exception ex) { // TODO: Log Logger.Initialization.Error($"IntelliSenseServer.Deactivate error: {ex}"); return(false); } }
// Should be called only on the Excel main thread, either from Unregister (AutoClose) // or via the control function from another server when that server figures out that it must become the active server. internal static bool Deactivate() { if (Thread.CurrentThread.ManagedThreadId != 1) { // At least try to log Logger.Initialization.Error($"IntelliSenseServer.Deactivate not called on the main Excel thread!"); } try { if (_helper != null) { _helper.Dispose(); } _isActive = false; ClearActiveRegistrationInfo(); return(true); } catch (Exception ex) { Logger.Initialization.Error($"IntelliSenseServer.Deactivate error: {ex}"); return(false); } }