示例#1
0
        public bool Init(IEnumerable <String> extensionDirs)
        {
            if (_agentsCache == null)
            {
                _agentsCache = new AgentsCache();
                _agentsCache.EvtAgentAdded += _agentsCache_EvtAgentAdded;
                _agentsCache.Init(extensionDirs);

                _genericAppAgent = _agentsCache.GetAgent(GenericAppAgentName);
                if (_genericAppAgent == null)
                {
                    _agentsCache.AddAgentByType(typeof(UnsupportedAppAgent));
                    _genericAppAgent = _agentsCache.GetAgent(GenericAppAgentName);
                }

                _agentsCache.AddAgentByType(typeof(NullAgent));
                _nullAgent = _agentsCache.GetAgent(NullAgentName);

                _dialogAgent      = _agentsCache.GetAgent(DialogControlAgentName);
                _menuControlAgent = _agentsCache.GetAgent(MenuControlAgentName);

                _textControlAgent = _genericAppAgent.TextControlAgent;

                WindowActivityMonitor.EvtFocusChanged += WindowActivityMonitor_EvtFocusChanged;

                getKeyboardActuator();

                WindowActivityMonitor.GetActiveWindow();
            }

            return(true);
        }
示例#2
0
文件: AgentManager.cs 项目: glwu/acat
        public bool Init(IEnumerable<String> extensionDirs)
        {
            if (_agentsCache == null)
            {
                _agentsCache = new AgentsCache();
                _agentsCache.EvtAgentAdded += _agentsCache_EvtAgentAdded;
                _agentsCache.Init(extensionDirs);

                _genericAppAgent = _agentsCache.GetAgent(GenericAppAgentName);
                if (_genericAppAgent == null)
                {
                    _agentsCache.AddAgentByType(typeof(UnsupportedAppAgent));
                    _genericAppAgent = _agentsCache.GetAgent(GenericAppAgentName);
                }

                _agentsCache.AddAgentByType(typeof(NullAgent));
                _nullAgent = _agentsCache.GetAgent(NullAgentName);

                _dialogAgent = _agentsCache.GetAgent(DialogControlAgentName);
                _menuControlAgent = _agentsCache.GetAgent(MenuControlAgentName);

                _textControlAgent = _genericAppAgent.TextControlAgent;

                WindowActivityMonitor.EvtFocusChanged += WindowActivityMonitor_EvtFocusChanged;

                //WindowActivityMonitor.GetActiveWindow();
            }

            return true;
        }