Example #1
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _windowInfo = null;
            ExitCode = CompletionCode.ContextSwitch;
            _switchWindowsScanner = Context.AppPanelManager.CreatePanel("SwitchWindowsScanner") as SwitchWindowsScanner;

            if (_switchWindowsScanner != null)
            {
                subscribeToEvents();

                _switchWindowsScanner.FilterByProcessName = FilterByProcessName;
                Context.AppPanelManager.ShowDialog(_switchWindowsScanner);
            }

            return true;
        }
Example #2
0
 /// <summary>
 /// Invoked when the selects a window in the switch windows scanner.
 /// Set focus to the selected window and quit the agent.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="windowInfo"></param>
 private void _switchWindowsScanner_EvtActivateWindow(object sender, EnumWindows.WindowInfo windowInfo)
 {
     _windowInfo = windowInfo;
     Windows.ActivateWindow(_windowInfo.Handle);
     closeScanner();
     Close();
 }
Example #3
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _windowInfo = null;
            ExitCode = CompletionCode.ContextSwitch;
            _switchWindowsScanner = Context.AppPanelManager.CreatePanel("SwitchWindowsScanner") as SwitchWindowsScanner;

            if (_switchWindowsScanner != null)
            {
                _switchWindowsScanner.FormClosing += _form_FormClosing;
                _switchWindowsScanner.EvtDone += _form_EvtDone;
                _switchWindowsScanner.EvtActivateWindow += _switchWindowsScanner_EvtActivateWindow;

                _switchWindowsScanner.FilterByProcessName = FilterByProcessName;
                Context.AppPanelManager.ShowDialog(_switchWindowsScanner);
            }

            return true;
        }