C# Class SIL.Utils.ScriptMaker

ScriptMaker creates scripts reflecting what the user does. They are designed for replay using Michael Lastufka's script engine. A ScriptMaker
Inheritance: IFWDisposable, IMessageFilter
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

Cleanup ( ) : void

Cleanup and stop logging.

Dispose ( ) : void

Must not be virtual.

GoTo ( string url ) : void

Insert a command to switch to the given URL (typically a FieldWorks one).

PreFilterMessage ( Message &m ) : bool

Every message in the system comes through here while we're logging!! We want to catch window creation and attach our event handlers.

ScriptMaker ( Control root ) : System

Create one that writes on the default 'Generated Script' file.

ScriptMaker ( Control root, StreamWriter destination ) : System

Create a ScriptMaker for the specified control (typically some type of main window) and all its children.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

Private Methods

Method Description
AccessPath ( Control cLeaf ) : string
AttachTo ( Control root ) : void
AttachTo ( MenuItem menu ) : void
Init ( Control root, StreamWriter destination ) : void
InterpretRole ( object role ) : string
ScriptMaker_Closed ( object sender, EventArgs e ) : void
c_ControlAdded ( object sender, System.Windows.Forms.ControlEventArgs e ) : void
menu_Click ( object sender, EventArgs e ) : void
root_KeyPress ( object sender, KeyPressEventArgs e ) : void
root_MouseDown ( object sender, MouseEventArgs e ) : void

Method Details

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

Cleanup() public method

Cleanup and stop logging.
public Cleanup ( ) : void
return void

Dispose() public method

Must not be virtual.
public Dispose ( ) : void
return void

Dispose() protected method

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GoTo() public method

Insert a command to switch to the given URL (typically a FieldWorks one).
public GoTo ( string url ) : void
url string
return void

PreFilterMessage() public method

Every message in the system comes through here while we're logging!! We want to catch window creation and attach our event handlers.
public PreFilterMessage ( Message &m ) : bool
m System.Windows.Forms.Message
return bool

ScriptMaker() public method

Create one that writes on the default 'Generated Script' file.
public ScriptMaker ( Control root ) : System
root System.Windows.Forms.Control
return System

ScriptMaker() public method

Create a ScriptMaker for the specified control (typically some type of main window) and all its children.
public ScriptMaker ( Control root, StreamWriter destination ) : System
root System.Windows.Forms.Control
destination System.IO.StreamWriter
return System