当前位置: 首页>>代码示例>>C#>>正文


C# WindowActivityMonitorInfo.ToString方法代码示例

本文整理汇总了C#中ACAT.Lib.Core.Utility.WindowActivityMonitorInfo.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# WindowActivityMonitorInfo.ToString方法的具体用法?C# WindowActivityMonitorInfo.ToString怎么用?C# WindowActivityMonitorInfo.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACAT.Lib.Core.Utility.WindowActivityMonitorInfo的用法示例。


在下文中一共展示了WindowActivityMonitorInfo.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnFocusChanged

        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString());

            base.OnFocusChanged(monitorInfo, ref handled);

            if (monitorInfo.IsNewWindow)
            {
                showPanelOnFocusChanged(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
                handled = true;
            }

            #if abc
            String panel = PanelClasses.None;
            handled = getPanel(monitorInfo, false, ref panel);

            if (handled)
            {
                showPanelOnFocusChanged(this, new PanelRequestEventArgs(panel, "Explorer", monitorInfo));
            }
            #endif
        }
开发者ID:nbsrujan,项目名称:acat,代码行数:22,代码来源:WindowsExplorerAgent.cs

示例2: OnFocusChanged

        /// <summary>
        /// Invoked when the focus changes either in the active window or when the
        /// active window itself changes.
        /// </summary>
        /// <param name="monitorInfo">Info about focused element</param>
        /// <param name="handled">was this handled</param>
        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString() + ", menushown: " + _scannerShown);

            base.OnFocusChanged(monitorInfo, ref handled);

            if (!_scannerShown && _launchAppScanner != null)
            {
                var arg = new PanelRequestEventArgs(PanelClasses.AlphabetMinimal, monitorInfo)
                {
                    TargetPanel = _launchAppScanner,
                    RequestArg = _launchAppScanner,
                    UseCurrentScreenAsParent = true
                };
                showPanel(this, arg);
                _scannerShown = true;
            }

            handled = true;
        }
开发者ID:nbsrujan,项目名称:acat,代码行数:26,代码来源:LaunchAppAgent.cs

示例3: OnFocusChanged

        /// <summary>
        /// Invoked when the focus changes either in the active window or when the
        /// active window itself changes.
        /// </summary>
        /// <param name="monitorInfo">Info about focused element</param>
        /// <param name="handled">was this handled</param>
        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString());

            base.OnFocusChanged(monitorInfo, ref handled);

            setTextInterface(textInterface);

            if (_menuShown)
            {
                return;
            }

            var arg = new PanelRequestEventArgs(PanelClasses.None, monitorInfo);
            handled = getLectureManagerPanel(arg);

            Log.Debug("handled: " + handled);

            if (handled)
            {
                _menuShown = true;
                Log.Debug("calling showpanel for : " + arg.PanelClass);

                showPanel(this, arg);
            }
        }
开发者ID:nbsrujan,项目名称:acat,代码行数:32,代码来源:LectureManagerAgent.cs

示例4: OnFocusChanged

        /// <summary>
        /// Invoked when the focus changes either in the active window or when the
        /// active window itself changes.
        /// </summary>
        /// <param name="monitorInfo">Info about focused element</param>
        /// <param name="handled">was this handled</param>
        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString());

            base.OnFocusChanged(monitorInfo, ref handled);
            Log.Debug("menuShown: " + _scannerShown + ", title: " + monitorInfo.Title);
            if (!_scannerShown && monitorInfo.Title == "Create New File")
            {
                var arg = new PanelRequestEventArgs("Alphabet", monitorInfo);
                _scannerShown = true;
                showPanel(this, arg);
            }

            handled = true;
        }
开发者ID:glwu,项目名称:acat,代码行数:21,代码来源:NewFileAgent.cs

示例5: OnFocusChanged

        /// <summary>
        /// Invoked when the focus changes either in the active window or when the
        /// active window itself changes.
        /// </summary>
        /// <param name="monitorInfo">Info about focused element</param>
        /// <param name="handled">was this handled</param>
        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString());

            base.OnFocusChanged(monitorInfo, ref handled);

            var handle = IntPtr.Zero;
            if (_form != null)
            {
                _form.Invoke(new MethodInvoker(delegate()
                    {
                        handle = _form.Handle;
                    }));
            }

            // if the abbreviations scanner is up, display the
            // alphabet scanner
            if (handle != IntPtr.Zero && monitorInfo.FgHwnd == handle)
            {
                if (!_scannerShown)
                {
                    var arg = new PanelRequestEventArgs(PanelClasses.AlphabetMinimal, monitorInfo)
                    {
                        RequestArg = _form,
                        TargetPanel = _form,
                        UseCurrentScreenAsParent = true
                    };
                    showPanel(this, arg);
                    _scannerShown = true;
                }
            }

            handled = true;
        }
开发者ID:nbsrujan,项目名称:acat,代码行数:40,代码来源:AbbreviationsAgent.cs

示例6: OnFocusChanged

        public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
        {
            Log.Debug("OnFocus: " + monitorInfo.ToString());

            base.OnFocusChanged(monitorInfo, ref handled);

            setTextInterface(textInterface);

            if (!_menuShown)
            {
                var arg = new PanelRequestEventArgs(PanelClasses.None, monitorInfo);
                handled = getPanel(arg);

                if (handled)
                {
                    _menuShown = true;
                    showPanel(this, arg);
                }
            }
        }
开发者ID:glwu,项目名称:acat,代码行数:20,代码来源:LectureManagerAgent.cs

示例7: activateAppAgent

        /// <summary>
        /// Activates an application agent depending on the context.
        /// The monitorInfo parameter has all the information to make
        /// this decision. Depending on the active foreground process,
        /// the appropriate agent is activated.  if there is no dedicated
        /// agent for the process, the generic agent is used.
        /// If a dialog the foreground window, the dialog agent is activated.
        /// If a menu has been activated, the menu agent is activated
        /// </summary>
        /// <param name="monitorInfo">Foreground window/process info</param>
        private void activateAppAgent(WindowActivityMonitorInfo monitorInfo)
        {
            if (_inActivateAppAgent)
            {
                Log.Debug("Already inside. returning");
                return;
            }

            Log.Debug("Before syncsetagent");
            lock (_syncActivateAgent)
            {
                _inActivateAppAgent = true;
                Log.Debug("After syncsetagent");
                try
                {
                    bool handled = false;

                    Log.Debug(monitorInfo.ToString());

                    // did a request for displaying the contextual
                    // menu come in?  If so handle it.

                    bool getContextMenu = _getContextMenu;

                    Log.Debug("getContextMenu: " + getContextMenu);

                    _getContextMenu = false;

                    String processName = monitorInfo.FgProcess.ProcessName;

                    // first check if there is an ad-hoc agent, if so,
                    // activate it
                    Log.Debug("Looking for adhoc agent for " + monitorInfo.FgHwnd);
                    IApplicationAgent agent = _agentsCache.GetAgent(monitorInfo.FgHwnd);
                    if (agent == null)
                    {
                        // check if a dialog or menu is active
                        Log.Debug("Adhoc agent not present for " + monitorInfo.FgHwnd);

                        if (EnableContextualMenusForDialogs &&
                            (String.Compare(processName, _currentProcessName, true) != 0) &&
                            isDialog(monitorInfo))
                        {
                            Log.Debug("Fg window is a dialog.  Setting agent to dialog agent");

                            agent = _dialogAgent;
                        }
                        else if (EnableContextualMenusForMenus && isMenu(monitorInfo))
                        {
                            Log.Debug("Fg window is a menu.  Setting agent to menu agent");
                            agent = _menuControlAgent;
                        }
                        else if (Windows.IsMinimized(monitorInfo.FgHwnd))
                        {
                            Log.Debug("Window is minimized. Use generic agent");
                            agent = _genericAppAgent;
                        }
                        else
                        {
                            // check if there is a dedicated agent for this process
                            Log.Debug("Getting agent for " + processName);
                            agent = _agentsCache.GetAgent(monitorInfo.FgProcess);
                        }
                    }
                    else
                    {
                        Log.Debug("Adhoc agent IS present for " + monitorInfo.FgHwnd);
                    }

                    Log.Debug("Current agent: " + ((_currentAgent != null) ?
                                                    _currentAgent.Name : "null") +
                                                    ", agent:  " + ((agent != null) ? agent.Name : "null"));

                    // if there is an agent switch, query the current agent
                    // if it is OK to switch. Some agents may not allow
                    // the switch
                    if (_currentAgent != null && _currentAgent != agent)
                    {
                        bool allowSwitch = _currentAgent.QueryAgentSwitch(agent);
                        Log.Debug("CurrentAgent is " + _currentAgent.Name + ", queryAgentSwitch: " + allowSwitch);
                        if (!allowSwitch)
                        {
                            _currentAgent.OnFocusChanged(monitorInfo, ref handled);
                            _textControlAgent = _currentAgent.TextControlAgent;
                            return;
                        }

                        _currentAgent.OnFocusLost();
                    }

//.........这里部分代码省略.........
开发者ID:glwu,项目名称:acat,代码行数:101,代码来源:AgentManager.cs

示例8: onFocusChanged

        /// <summary>
        /// Event triggered when the active foreground window changes
        /// or if focus changes within the foreground window
        /// </summary>
        /// <param name="monitorInfo">Info about focused element</param>
        private void onFocusChanged(WindowActivityMonitorInfo monitorInfo)
        {
            if (monitorInfo.FgHwnd == IntPtr.Zero)
            {
                Log.Debug("hWnd is null");
                return;
            }

            Log.Debug(monitorInfo.ToString());

            //Log.Debug(" hwnd: " + hWnd + " Title:  [" + title + "] process: " + process.ProcessName +
            //      ". focusedElement: [" +
            //  ((focusedElement != null) ? focusedElement.Current.ClassName : "null") + "]");

            bool handled = false;
            if (_currentAgent is IFunctionalAgent)
            {
                _currentAgent.OnFocusChanged(monitorInfo, ref handled);
            }
            else
            {
                if (EnableAppAgentContextSwitch)
                {
                    activateAppAgent(monitorInfo);
                }
                else
                {
                    disallowContextSwitch(monitorInfo);
                }
            }

            if (_currentAgent != null)
            {
                Log.Debug("CurrentAgent is " + _currentAgent.GetType());
            }

            if (EvtFocusChanged != null)
            {
                EvtFocusChanged(this, new FocusChangedEventArgs(monitorInfo));
            }
            else
            {
                Log.Debug("EVTFocusChanged is null!");
            }
        }
开发者ID:glwu,项目名称:acat,代码行数:50,代码来源:AgentManager.cs


注:本文中的ACAT.Lib.Core.Utility.WindowActivityMonitorInfo.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。