C# Class ACAT.Lib.Extension.AppAgents.WindowsExplorer.WindowsExplorerAgentBase

Base class application agent for Windows Explorer. Enables navigation through files and folders in Explorer, create folders, clipboard operations, opening files etc.
Inheritance: ACAT.Lib.Core.AgentManagement.GenericAppAgentBase
Exibir arquivo Open project: brlima94/acat-localization

Protected Properties

Property Type Description
autoSwitchScanners bool

Public Methods

Method Description
CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : void

Invoked to set the 'enabled' state of a widget. This will depend on the current context.

OnContextMenuRequest ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void

Displays the contextual menu

OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void

Invoked when the foreground window focus changes. Depending on which element has focus in the acrobat reader window, display the appropriate scanner

OnFocusLost ( ) : void

Focus shifted to another app. This agent is getting deactivated.

OnRunCommand ( String command, object commandArg, bool &handled ) : void

Invoked to run a command

Protected Methods

Method Description
getMenu ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, String &panelClass ) : bool

Gets the menu for the Explorer window in focus. Checks if the file explorer is active and returns the contextual menu name for it

getWindowElement ( IntPtr hWndMain ) : AutomationElement

Returns the automation element for the window handle

isDesktopWindow ( AutomationElement focusedElement ) : bool

Checks if the focused element is the desktop

isFileExplorer ( AutomationElement windowElement ) : bool

Checks if the window element is the Windows Explorer window

Private Methods

Method Description
displayScanner ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void

Displays the scanner appropriate for the element that is currently in focus in the Windows explorer window

showMenu ( String menuName, String title ) : void

Dispays the menu indicated by the menu name

Method Details

CheckWidgetEnabled() public method

Invoked to set the 'enabled' state of a widget. This will depend on the current context.
public CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : void
arg ACAT.Lib.Core.AgentManagement.CheckEnabledArgs contains info about the widget
return void

OnContextMenuRequest() public method

Displays the contextual menu
public OnContextMenuRequest ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo Foreground window info
return void

OnFocusChanged() public method

Invoked when the foreground window focus changes. Depending on which element has focus in the acrobat reader window, display the appropriate scanner
public OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo Foreground window info
handled bool set to true if handled
return void

OnFocusLost() public method

Focus shifted to another app. This agent is getting deactivated.
public OnFocusLost ( ) : void
return void

OnRunCommand() public method

Invoked to run a command
public OnRunCommand ( String command, object commandArg, bool &handled ) : void
command String The command to execute
commandArg object Optional arguments for the command
handled bool set this to true if handled
return void

getMenu() protected method

Gets the menu for the Explorer window in focus. Checks if the file explorer is active and returns the contextual menu name for it
protected getMenu ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, String &panelClass ) : bool
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo fg window info
panelClass String returns the panel class of the menu
return bool

getWindowElement() protected method

Returns the automation element for the window handle
protected getWindowElement ( IntPtr hWndMain ) : AutomationElement
hWndMain System.IntPtr window handle
return System.Windows.Automation.AutomationElement

isDesktopWindow() protected method

Checks if the focused element is the desktop
protected isDesktopWindow ( AutomationElement focusedElement ) : bool
focusedElement System.Windows.Automation.AutomationElement element in focus
return bool

isFileExplorer() protected method

Checks if the window element is the Windows Explorer window
protected isFileExplorer ( AutomationElement windowElement ) : bool
windowElement System.Windows.Automation.AutomationElement element in focus
return bool

Property Details

autoSwitchScanners protected_oe property

If set to true, the agent will autoswitch the scanners depending on which element has focus. Eg: Alphabet scanner if an edit text window has focus, the contextual menu if the main document has focus
protected bool autoSwitchScanners
return bool