本文整理汇总了C#中ACAT.Lib.Core.Utility.WindowActivityMonitorInfo类的典型用法代码示例。如果您正苦于以下问题:C# WindowActivityMonitorInfo类的具体用法?C# WindowActivityMonitorInfo怎么用?C# WindowActivityMonitorInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowActivityMonitorInfo类属于ACAT.Lib.Core.Utility命名空间,在下文中一共展示了WindowActivityMonitorInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckEnabledArgs
/// <summary>
/// Initializes a new instance of the class.
/// </summary>
/// <param name="monitorInfo">Active window info</param>
/// <param name="widget">Scanner button that needs to be enabled/disabled</param>
public CheckEnabledArgs(WindowActivityMonitorInfo monitorInfo, Widget widget)
{
Handled = false;
Enabled = false;
Widget = widget;
MonitorInfo = monitorInfo;
}
示例2: PanelRequestEventArgs
/// <summary>
/// Initializes a new instance of the class.
/// </summary>
/// <param name="panelClass">The scanner to be activted</param>
/// <param name="monitorInfo">Contextual info about app window</param>
public PanelRequestEventArgs(String panelClass, WindowActivityMonitorInfo monitorInfo)
{
init();
PanelClass = panelClass;
MonitorInfo = monitorInfo;
}
示例3: OnFocusChanged
public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug();
setTextInterface(_textInterface);
handled = true;
}
示例4: OnContextMenuRequest
public override void OnContextMenuRequest(WindowActivityMonitorInfo monitorInfo)
{
#if AUTO_SWITCH_SCANNER
String panelClass = PanelClasses.None;
if (!getPanel(monitorInfo, true, ref panelClass))
{
if (isDesktopWindow(monitorInfo.FocusedElement))
{
showPanel(this, new PanelRequestEventArgs("WindowsDesktopContextMenu", "Desktop", monitorInfo));
return;
}
}
showPanel(this, new PanelRequestEventArgs(panelClass, "Explorer", monitorInfo));
#endif
}
示例5: 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);
}
}
}
示例6: OnFocusChanged
/// <summary>
/// Invoked when the foreground window focus changes. Display the
/// contextual menus for dialogs which will allow interaction with the dialog
/// </summary>
/// <param name="monitorInfo">Foreground window info</param>
/// <param name="handled">set to true if handled</param>
public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug();
Log.Debug("prevHwnd: " + _prevHwnd + ", fgHwnd: " + monitorInfo.FgHwnd);
if (autoSwitchScanners && _prevHwnd != monitorInfo.FgHwnd)
{
Log.Debug("They are not equal. Show dialog panel");
base.OnFocusChanged(monitorInfo, ref handled);
showPanel(this, new PanelRequestEventArgs(PanelClasses.DialogContextMenu,
monitorInfo.Title,
monitorInfo));
_prevHwnd = monitorInfo.FgHwnd;
}
handled = true;
}
示例7: 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
}
示例8: OnFocusChanged
/// <summary>
/// Invoked when the foreground window focus changes. Displays the
/// scanner depending on the context. Also, if this is a new window that has
/// come into focus, adds its contents to the word prediction temporary batch model for more
/// contextual prediction of words
/// </summary>
/// <param name="monitorInfo">Foreground window info</param>
/// <param name="handled">set to true if handled</param>
public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug();
if (String.Compare(monitorInfo.FocusedElement.Current.ClassName, DocClassName, true) == 0)
{
createMSWordTextInterface();
if (monitorInfo.IsNewFocusedElement)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
}
if (monitorInfo.IsNewWindow)
{
loadWordPredictionContext();
}
}
else if (autoSwitchScanners)
{
if (isRecentDocuments(monitorInfo.FocusedElement))
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.DialogContextMenu, ScannerTitle, monitorInfo));
}
else if (String.Compare(monitorInfo.FocusedElement.Current.ClassName, "NetUIToolWindow") == 0)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.MenuContextMenu, ScannerTitle, monitorInfo));
}
else
{
handled = false;
return;
}
}
else if (!_scannerShown)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
_scannerShown = true;
}
handled = true;
}
示例9: displayScanner
/// <summary>
/// Displays the scanner appropriate for the element that is currently
/// in focus in the Windows explorer window
/// </summary>
/// <param name="monitorInfo">Foreground window info</param>
/// <param name="handled">set to true if handled</param>
private void displayScanner(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug("KILLROY Entered");
if (monitorInfo.FocusedElement.Current.ControlType.ProgrammaticName == "ControlType.Edit")
{
Log.Debug("KILLROY controtype edit");
base.OnFocusChanged(monitorInfo, ref handled);
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
_scannerShown = true;
}
else// if (monitorInfo.IsNewWindow)
{
Log.Debug("KILLROY calling getmenu");
String panel = PanelClasses.None;
handled = getMenu(monitorInfo, ref panel);
if (handled)
{
showPanel(this, new PanelRequestEventArgs(panel, "Explorer", monitorInfo));
_scannerShown = true;
}
}
#if abc
else
{
Log.Debug("KILLROY *** FALL THROUGH> WILL NOT BE HANDLED");
//handled = true;
}
#endif
}
示例10: OnFocusChanged
/// <summary>
/// Invoked when the foreground window focus changes. Depending on which
/// element has focus in the acrobat reader window, display the appropriate
/// scanner
/// </summary>
/// <param name="monitorInfo">Foreground window info</param>
/// <param name="handled">set to true if handled</param>
public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug();
if (monitorInfo.IsNewWindow)
{
_scannerShown = false;
}
if (autoSwitchScanners)
{
if (!_scannerShown)
{
displayScanner(monitorInfo, ref handled);
}
else
{
handled = true;
}
}
else
{
base.OnFocusChanged(monitorInfo, ref handled);
if (!_scannerShown)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
_scannerShown = true;
}
handled = true;
}
}
示例11: autoDisplayScanner
/// <summary>
/// Displays the scanner that is appropriate for the element in focus
/// </summary>
/// <param name="monitorInfo">Foreground window info</param>
/// <param name="handled">set to true if handled</param>
private void autoDisplayScanner(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
handled = true;
if (_explorerElements.IsFavoritesWindow(monitorInfo.FocusedElement) ||
_explorerElements.IsHistoryWindow(monitorInfo.FocusedElement) ||
_explorerElements.IsFeedsWindow(monitorInfo.FocusedElement))
{
if (!_scannerType.HasFlag(ScannerType.Favorites))
{
var args = new PanelRequestEventArgs(PanelClasses.MenuContextMenu, ScannerTitle, monitorInfo)
{
UseCurrentScreenAsParent = true
};
showPanel(this, args);
_scannerType = ScannerType.Favorites;
}
}
else if (_explorerElements.IsSearchControl(monitorInfo.FocusedElement) ||
_explorerElements.IsFindControl(monitorInfo.FocusedElement) ||
_explorerElements.IsAddressWindow(monitorInfo.FocusedElement))
{
if (!_scannerType.HasFlag(ScannerType.Address))
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
_scannerType = ScannerType.Address;
}
}
else if (!_scannerType.HasFlag(ScannerType.Other))
{
showPanel(this, new PanelRequestEventArgs("InternetExplorerContextMenu", ScannerTitle, monitorInfo));
_scannerType = ScannerType.Other;
}
}
示例12: 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>
public void OnFocusChanged(WindowActivityMonitorInfo monitorInfo)
{
_alphabetScannerCommon.OnFocusChanged(monitorInfo);
}
示例13: IsOpenNoteWindow
/// <summary>
/// Is the active window an open Outlook "Note" window?
/// </summary>
/// <param name="monitorInfo">Active window info</param>
/// <param name="subType">The focused Outlook window control element </param>
/// <returns>true if it is</returns>
public bool IsOpenNoteWindow(WindowActivityMonitorInfo monitorInfo, ref OutlookControlSubType subType)
{
bool retVal = false;
subType = OutlookControlSubType.Unknown;
var element = AgentUtils.GetElementOrAncestorByAutomationId(monitorInfo.FocusedElement, "RichEdit20WPT", "ControlType.Edit", "4159");
if (element != null)
{
var name = element.Current.Name;
retVal = (name == "Note text");
}
if (retVal)
{
if (AgentUtils.IsElementByAutomationId(monitorInfo.FocusedElement, "RichEdit20WPT", "ControlType.Edit", "4159"))
{
subType = OutlookControlSubType.OpenNoteMessageBodyField;
}
}
return retVal;
}
示例14: IsOpenContactWindow
/// <summary>
/// Is the active window an open "Contact" window?
/// </summary>
/// <param name="monitorInfo">Active window info</param>
/// <param name="subType">The focused Outlook window control element </param>
/// <returns>true if it is</returns>
public bool IsOpenContactWindow(WindowActivityMonitorInfo monitorInfo, ref OutlookControlSubType subType)
{
Log.Debug();
subType = OutlookControlSubType.Unknown;
bool retVal = true;
if (monitorInfo.FocusedElement == null)
{
return false;
}
var windowElement = AutomationElement.FromHandle(monitorInfo.FgHwnd);
var element = (AgentUtils.FindElementByAutomationId(windowElement, "RichEdit20WPT", ControlType.Edit, "4481", "Company:") ??
AgentUtils.FindElementByAutomationId(windowElement, "RichEdit20WPT", ControlType.Edit, "4480", "Job Title:")) ??
AgentUtils.FindElementByAutomationId(windowElement, "RichEdit20WPT", ControlType.Edit, "4096", "FullName");
retVal = (element != null);
if (retVal)
{
if (AgentUtils.IsElementByAutomationId(monitorInfo.FocusedElement, "_WwG", "ControlType.Pane", "", "Message"))
{
subType = OutlookControlSubType.ContactMessageField;
}
}
Log.Debug("Returning " + retVal);
return retVal;
}
示例15: IsNotesWindow
/// <summary>
/// Is the active window the "Contacts" window?
/// </summary>
/// <param name="monitorInfo">Active window info</param>
/// <returns>true if it is</returns>
public bool IsNotesWindow(WindowActivityMonitorInfo monitorInfo)
{
return (monitorInfo.Title.StartsWith("Notes - ") && monitorInfo.Title.EndsWith("Microsoft Outlook"));
}