ExcelDna.Integration.SynchronizationManager.Install C# (CSharp) Method

Install() static private method

static private Install ( ) : void
return void
        internal static void Install()
        {
            if (!ExcelDnaUtil.IsMainThread)
            {
                Logger.Initialization.Error("SynchronizationManager must be Installed from the main Excel thread.");
                return;
            }
            if (_syncWindow == null)
            {
                Logger.Initialization.Info("SynchronizationManager - Install");
                _syncWindow = new SynchronizationWindow();
            }
        }

Usage Example

Example #1
0
        // The idea is that initialize compiles, loads and sorts out the assemblies,
        //    but does not depend on any calls to Excel.
        // Then Initialize can be called during RTD registration or loading,
        //    without 'AutoOpening' the add-in
        internal void Initialize()
        {
            // Get MethodsInfos and AddIn classes from assemblies
            List <Type> rtdServerTypes             = new List <Type>();
            List <ExcelComClassType> comClassTypes = new List <ExcelComClassType>();

            // Recursively get assemblies down .dna tree.
            List <ExportedAssembly> assemblies = GetAssemblies(dnaResolveRoot);

            AssemblyLoader.ProcessAssemblies(assemblies, _methods, _addIns, rtdServerTypes, comClassTypes);

            // Register RTD Server Types immediately
            RtdRegistration.RegisterRtdServerTypes(rtdServerTypes);

            // CAREFUL: This interacts with the implementation of ExcelRtdServer to implement the thread-safe synchronization.
            // Check whether we have an ExcelRtdServer type, and need to install the Sync Window
            // Uninstalled in the AutoClose
            bool registerSyncManager = false;

            foreach (Type rtdType in rtdServerTypes)
            {
                if (rtdType.IsSubclassOf(typeof(ExcelRtdServer)))
                {
                    registerSyncManager = true;
                    break;
                }
            }
            if (registerSyncManager)
            {
                SynchronizationManager.Install();
            }

            // Register COM Server Types immediately
            ComServer.RegisterComClassTypes(comClassTypes);
        }
All Usage Examples Of ExcelDna.Integration.SynchronizationManager::Install
SynchronizationManager