internal void AutoClose()
{
UnloadCustomUI();
foreach (AssemblyLoader.ExcelAddInInfo addIn in _addIns)
{
try
{
if (addIn.AutoCloseMethod != null)
{
addIn.AutoCloseMethod.Invoke(addIn.Instance, null);
}
}
catch (Exception e)
{
// TODO: What to do here?
Debug.WriteLine(e.Message);
}
}
// This is safe, even if never registered
SynchronizationManager.Uninstall();
RegistrationInfo.Unregister();
_addIns.Clear();
}