C# Class ACAT.Extensions.Default.FunctionalAgents.NewFile.NewFileAgent

Inheritance: ACAT.Lib.Core.AgentManagement.FunctionalAgentBase
Afficher le fichier Open project: brlima94/acat-localization

Méthodes publiques

Méthode Description
Activate ( ) : bool

Invoked when the Functional agent is activated. This is the entry point into this agent.

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.

NewFileAgent ( ) : 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.

OnPanelClosed ( String panelClass, ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void

Invoked when the scanner is closed

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

Méthodes protégées

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

Creates and returns the text control object for this agent

Private Methods

Méthode Description
_newFileNameForm_EvtDone ( bool flag ) : void

Form is closing. quit

activateWindow ( IntPtr handle ) : void

Sets focus to the indicated window

checkValidOrCreate ( String folder ) : bool

Checks if the specified folder is valid Display error if is not valid

confirm ( String prompt ) : bool

Gets confirmation from the user

createAndLaunchNotepad ( String fileName ) : bool

Creates a text file and launches notepad

createAndLaunchWordDoc ( String fileName ) : bool

Creates a word doc and launches word

createFileAndLaunchApp ( String fileName ) : bool

Creates the indicated file and launches the app with the file so the user can start working on it

handleDone ( ) : void

User has entered the filename. Create the file, launch the app and quit

handleQuit ( bool showPrompt = true ) : void

Handle quit by asking the user if there is a need to ask. Close forms

showFileChoices ( ) : String

Displays a menu to let the user to select whether to create a text file or a word doc

showNewFileDialogForTextFile ( ) : void

Shows the new file form to create a text file

showNewFileDialogForWordDoc ( ) : void

Shows the new file form to create a word document

waitForProcessAndActivate ( Process process ) : void

Waits for the process to start and activates the window

waitForWordWindow ( String fileName ) : void

Waits for MS Word to start. Does this by checking if the window with the file name title was created

Method Details

Activate() public méthode

Invoked when the Functional agent is activated. This is the entry point into this agent.
public Activate ( ) : bool
Résultat bool

CheckWidgetEnabled() public méthode

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
Résultat void

NewFileAgent() public méthode

Initializes a new instance of the class.
public NewFileAgent ( ) : System
Résultat System

OnFocusChanged() public méthode

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
Résultat void

OnPanelClosed() public méthode

Invoked when the scanner is closed
public OnPanelClosed ( String panelClass, ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void
panelClass String name of scanner being closed
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo foreground window info
Résultat void

OnRequestClose() public méthode

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

OnRunCommand() public méthode

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?
Résultat void

createEditControlTextInterface() protected méthode

Creates and returns the text control object for this agent
protected createEditControlTextInterface ( IntPtr handle, AutomationElement focusedElement, bool &handled ) : ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase
handle System.IntPtr handle of the edit control
focusedElement System.Windows.Automation.AutomationElement automation element
handled bool was this handled?
Résultat ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase