C# Class ACAT.Lib.Extension.AppAgents.Notepad.NotepadAgentBase

Base class for the Application agent for Notepad.
Inheritance: ACAT.Lib.Core.AgentManagement.GenericAppAgentBase
Exibir arquivo Open project: brlima94/acat-localization

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. Displays the alphabet scanner. 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

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
createEditControlTextInterface ( IntPtr handle, AutomationElement focusedElement, bool &handled ) : ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase

Creates the text control agent for notepad

Private Methods

Method Description
getFileNameFromWindow ( ) : String

Parses the title of the notepad window and extracts the file name from it

getNotepadText ( ) : String

Returns text from the notepad window

launchLectureManager ( ) : System.Threading.Tasks.Task

Launches lecture manager with text from the notepad window. This function returns only after lecture manager has exited

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. Displays the alphabet scanner. 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
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

createEditControlTextInterface() protected method

Creates the text control agent for notepad
protected createEditControlTextInterface ( IntPtr handle, AutomationElement focusedElement, bool &handled ) : ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase
handle System.IntPtr Handle to the notepad window
focusedElement System.Windows.Automation.AutomationElement automation element for the notepad text control
handled bool set to true if handled
return ACAT.Lib.Core.AgentManagement.TextInterface.TextControlAgentBase