本文整理汇总了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
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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();
}
//.........这里部分代码省略.........
示例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!");
}
}