GeneratorBase

Class Overview
Generator base class. 
All generators must inherit this class. If you define a child class and create a mapping to the target controls using the plugin XML format, the class will be instantiated in the target application and have Attach() called during the "generate code from interactions" operation.



public Object ControlObject {get;}
Description
Target control object of the code generation operation.
Returns null for native windows.


public IntPtr WindowHandle {get;}
Description
Target window handle of the code generation. 
Returns IntPtr.Zero for WPF controls.


public List<Sentence> CurrentCode {get;}
Description
The current code.


public string Name {get; set;}
Description
Variable name that is assigned to the control by TestAssistant.


protected void AddSentence (Sentence sentence)
Description
Adds a sentence.

Parameter
sentence
The sentence.


protected void AddSentence (params object [] tokens)
Commentary
Adds a sentence.

Parameter
tokens
Tokens to be included in the sentence.


public void Attach ()
Description
Attach operation. 
Causes the test object to attach to the target window.
Also attaches events in the case of .NET windows.


public void Detach ()
Description
Detach operation. 
Detaches the test object from the window.
Also disconnects events in the case of .NET windows.



public void Dispose ()
Description
Disposes the object.


~ GeneratorBase ()
Description
Destructor.


protected void Dispose (bool disposing)
Description
Disposes the object.

Parameter
disposing
Discard flag.


public void Initialize (string name, IntPtr windowHandle, Object controlObject, List `1 currentCode)
Description
Initialization.

Parameters
name
Name.
windowHandle
Window handle.
controlObject
Control object.
currentCode
Code buffer.


public void Optimize (List <Sentence> code)
Description
Optimization.

Parameter
code
Code.

JR