ExcelDna.Integration.DnaLibrary.AutoClose C# (CSharp) Method

AutoClose() private method

private AutoClose ( ) : void
return void
        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();
        }