/// <summary>
 /// Creates the singleton instance.
 /// </summary>
 /// <param name="theConfigManager">The config manager.</param>
 public static void CreateInstance(IUnityContainer container,
                                   ICommandManager commandManager,
                                   IInteractionManager interactionManager,
                                   IAgent agent,
                                   ILogger log)
 {
     Default = new JabraUtils(container, commandManager, interactionManager, agent, log);
 }
Esempio n. 2
0
        public void Initialize()
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Initialize");
            }

            // Initiliaze Module Options and Utils Singletons
            JabraOptions.CreateInstance(configManager);
            JabraUtils.CreateInstance(container, commandManager, interactionManager, agent, log);

            // Subscribe to LoginPreEvent and LogoutPreEvent
            // LoginPreEvent:
            // - will be triggered when the Workspace Desktop Edition native modules have finished their initialization
            // - useful to wait for this event when commands have to be inserted in WDE native chain of commands, or when subscribe on some native event handlers
            // LogoutPreEvent:
            // - will be triggered before the Workspace Desktop Edition application is exited
            subscriptionTokenLoginEvent  = eventAggregator.GetEvent <LoginPreEvent>().Subscribe(LoginEventHandler, ThreadOption.PublisherThread, true);
            subscriptionTokenLogoutEvent = eventAggregator.GetEvent <LogoutPreEvent>().Subscribe(LogoutEventHandler, ThreadOption.PublisherThread, true);

            this.InitializeOnStart();
        }