C# Class ACAT.Extensions.Default.FunctionalAgents.FileBrowserAgent.FileBrowserAgent

Inheritance: ACAT.Lib.Core.AgentManagement.FunctionalAgentBase
Show file Open project: brlima94/acat-localization

Public Methods

Method Description
Activate ( ) : bool

Invoked when the Functional agent is activated. This is the entry point for this agent. Show the scanner that will display the list of files from the preferred folders(s)

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

Invoked to check if a scanner button should be enabled. Uses context to determine the 'enabled' state.

FileBrowserAgent ( ) : System

Initializes a new instance of the class.

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

Invoked when the focus changes either in the active window or when the active window itself changes.

OnRequestClose ( ) : bool

A request came in to close the agent. We MUST quit if this call is ever made

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

Invoked when there is a request to run a command. This could as a result of the user activating a button on the scanner and there is a command associated with the button

Protected Methods

Method Description
createEditControlTextInterface ( IntPtr handle, AutomationElement focusedElement, bool &handled ) : ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase

Returns the text control interface object

Private Methods

Method Description
_fileBrowserScanner_EvtFileOpen ( object sender, EventArgs e ) : void

Event handler for when the user selects a file. Depending on the configuration, either the file will be opened or the name of the file will be returned to the caller. The SelectedFile property will contain the name of the selected file.

_fileBrowserScanner_EvtShowScanner ( object sender, EventArgs eventArgs ) : void

Event handler for when the file browser scanner requests for an alphabet scanner to be displayed.

_form_EvtDone ( bool flag ) : void

We are done. Quit!

_form_FormClosing ( object sender, FormClosingEventArgs e ) : void

Form is closing. Cleanup

activateWindow ( IntPtr handle ) : void

Activates the window represented by the handle and sets it as the foreground window

activateWindowIfAlreadyOpen ( String fileName ) : bool

For text files, checks if the file is already open in notepad. IF so, activates the window

closeScanner ( ) : void

Closes the file browser scanner

handleOpenFile ( String fileName ) : void

Handles file open operation. Uses file association to determine which app opens the file. Starts notepad for text files.

initProperties ( ) : void

Initializes the agent

quit ( ) : void

Close all the forms

quitFileBrowser ( ) : void

Gets confirmation from the user and quits

startWithNotepad ( String fileName ) : void

Launches the specified file in notepad

subscribeToEvents ( ) : void

Subscribes to events

unsubscribeFromEvents ( ) : void

Unsubscribes from events

waitForProcessAndActivate ( Process process ) : void

Waits for process to come up. Checks the process mainhandle to get activated.

Method Details

Activate() public method

Invoked when the Functional agent is activated. This is the entry point for this agent. Show the scanner that will display the list of files from the preferred folders(s)
public Activate ( ) : bool
return bool

CheckWidgetEnabled() public method

Invoked to check if a scanner button should be enabled. Uses context to determine the 'enabled' state.
public CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : void
arg ACAT.Lib.Core.AgentManagement.CheckEnabledArgs info about the scanner button
return void

FileBrowserAgent() public method

Initializes a new instance of the class.
public FileBrowserAgent ( ) : System
return System

OnFocusChanged() public method

Invoked when the focus changes either in the active window or when the active window itself changes.
public OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo Info about focused element
handled bool was this handled
return void

OnRequestClose() public method

A request came in to close the agent. We MUST quit if this call is ever made
public OnRequestClose ( ) : bool
return bool

OnRunCommand() public method

Invoked when there is a request to run a command. This could as a result of the user activating a button on the scanner and there is a command associated with the button
public OnRunCommand ( String command, object commandArg, bool &handled ) : void
command String command to run
commandArg object any optional arguments
handled bool was this handled?
return void

createEditControlTextInterface() protected method

Returns the text control interface object
protected createEditControlTextInterface ( IntPtr handle, AutomationElement focusedElement, bool &handled ) : ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase
handle System.IntPtr handle to the edit control
focusedElement System.Windows.Automation.AutomationElement automation element
handled bool was this handled?
return ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase