HostLink class library reference
Below is a summary of all the HostLink Class Library Reference available for .NET in HostFront 5.0
Table 5: HostFront .NET HostLink class library
Associated methods Associated properties
CreateXMLHost
Detach
DumpScreenToTextFile
DumpClientScreenToTextFile
DumpClientScreenToString
FieldExist (System.Int32 row,System.Int32 column)
GetConnectionInfo
GetEditableFields (System.Int32 row)
GetField (System.Int32 row, System.Int32 column)
GetField (System.Int32,System.Int32)
GetField (System.Int32, System.Int32, HostFront.Block.TrimOption)
GetField (System.Int32,System.Int32,System.Int32)
GetField (System.Int32, System.Int32, System.Int 32, HostFront.Block.TrimOption)
GetField (System.String,System.Int32)
GetField (System.String, System.Int32, HostFront.Block.TrimOption)
GetFieldColor (System.Int32 row, System.Int32 column)
GetFieldEditFlags (System.Int32 row,System.Int32 column)
GetFieldLength (System.Int32 row,System.Int32 column)
GetFieldStart (System.Int32 row,System.Int32 column)
GetFieldStatusFlags (System.Int32 row,System.Int32 column)
GetReadOnlyFields (System.Int32 row)
GetRow (System.Int32 row)
GetScreenField (System.Int32 row,System.Int32)
HostFrontServerAddress
HostFrontServerPort
IsConnected
IsFieldEditable (System.Int32 row,System.Int32 column)
IsKeyboardLocked
LightPenSelect (System.Int32 row,System.Int32 column)
OverrideNumericFields
PushKey (HostFront.EAI.Key,System.Int32)
PushKey (HostFront.EAI.Key,HostFront.EAI.ScreenIdentifierSystem.Int32)
PushKey (HostFront.EAI.Key, HostFront.EAI.ScreenIdentifier)
PushKey (HostFront.EAI.Key)
PushKey (System.Int32,System.Int32)
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier,System.Int32)
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier)
PushKey (System.Int32)
PutField (System.String,System.Int32,System.Int32)
PutField (System.String, System.Int32, System.Int32, System.Boolean)
ScreenToString()
ScreenHeight
ScreenWidth
ServerVersion
SessionID
SetCursor (System.Int32,System.Int32)
SetLanguage (HostFront.EAI.Language language)
ArabicFlags
Close
ConnectionType
CurrentScreen
CursorColumn
CursorRow
Emulation
ErrorMessage
Table 6: XMLHost class library
Associated method Associated property
GetScreen (System.Xml.XmlTextWriter) HostLink
Methods
The following methods are associated with the HostLink class.
CreateXMLHost
Returns a reference to the XML object.
Prototype
public HostFront.EAI.XmlHost CreateXMLHost ( )
Member of HostFront.EAI.HostLink
Return
Returns an Xmlhost object if connected. Otherwise, a null is returned.
Detach
Closes the connection to HostFront server but does not terminate the session on the host. This method is abstract.
Prototype
public abstract virtual System.String Detach ( )
Member of HostFront.EAI.HostLink
Return
Returns the HostFront session id of the connection. This value can later be used with Attach so the object can "attach" to an existing session on the host.
DumpScreenToTextFile
Dumps the current screen to the specified text file. If the file exists, text will be appended. This method throws an exception if anything goes wrong.
Prototype
public void DumpScreenToTextFile (System.String sFilePath)
Member of HostFront.EAI.HostLink
Parameters
sFilePath: Path of the file to write to.
Return
None.
DumpClientScreenToTextFile
Dumps the current screen from the client side to the specified text file. If the file exists, text will be appended. The resulting text file from this method will show the values entered by the application (using PutField method for example.) This method throws an exception if anything goes wrong.
Prototype
public void DumpClientScreenToTextFile (string sFilePath,bool bShowPassword)
Member of HostFront.EAI.HostLink
Parameters
sFilePath: Path of the file to write to.
bShowPassword: True to dump passwords as clear text. False to dump passwords as asterisks (***).
Return
None.
DumpClientScreenToString()
Dumps the current screen from the client side to a string. The resulting string from this method will show the values entered by the application (using PutField method for example.) This method throws an exception if anything goes wrong.
Prototype
public string DumpClientScreenToString()
Member of HostFront.EAI.HostLink
Return
String
FieldExist (System.Int32 row,System.Int32 column)
Checks whether a field exists or not.
Prototype
public System.Boolean FieldExist (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Return
True if field exists at the given position, false otherwise.
GetConnectionInfo
Retrieves the connection information to the host. This method is abstract.
Prototype
public abstract virtual HostFront.EAI.ConnectionInfo GetConnectionInfo ( )
Member of HostFront.EAI.HostLink
Return
The ConnectionInfo structure indicating the returned values.
GetEditableField (System.Int32 row)
Get a ScreenFields class containing all the writable fields of the specified row.
Prototype
public HostFront.EAI.ScreenFields GetEditableFields ()
Member of HostFront.EAI.HostLink
Parameters
Row: The row position.
Return
A HostFront.EAI.ScreenFields class.
GetField (System.Int32 row,System.Int32 column)
Retrieves the information for the field located at a given row and column position
Prototype
public HostFront.EAI.ScreenField GetField (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Return
Returns an instance of the ScreenField class.
GetField (System.Int32,System.Int32)
Retrieves the field value at a given row and column position.
Prototype
public System.String GetField (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns the field value.
GetField (System.Int32, System.Int32, HostFront.Block.TrimOption)
Retrieves the field value at a given row and column position with an option to trim the text value.
Prototype
public System.String GetField (System.Int32 row,System.Int32 column, HostFront.Block.TrimOption trimOption)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
trimOption: Enumerator with 4 options (NoTrim, Trim, TrimEnd, TrimStart)
Returns
Returns the field value.
GetField (System.Int32,System.Int32,System.Int32)
Retrieves the field value beginning from a given row and column position and ending at a second column position. This function returns a substring of the field value.
Prototype
public System.String GetField (System.Int32 row,System.Int32 columnStrat,System.Int32 columnEnd, HostFront.Block.TrimOption trimOption)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
ColumnStart: The starting column position of the field.
ColumnEnd: The ending column position of the field (specify -1 if you do not use this parameter).
Returns
Returns the field value.
GetField (System.Int32, System.Int32, System.Int32, HostFront.Block.TrimOption)
Retrieves the field value at a given row and column position ending at the given ending column position with an option to trim the text value.
Prototype
public System.String GetField (System.Int32 row,System.Int32 columnStrat,System.Int32 columnEnd, HostFront.Block.TrimOption trimOption)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column Start: The field starting column position.
Column End: The field ending column position.
trimOption: Enumerator with 4 options (NoTrim, Trim, TrimEnd, TrimStart)
Returns
Returns the field value.
GetField (System.String,System.Int32)
Retrieves the field value located by a specified number of fields to the right of a search field.
Prototype
public System.String GetField (System.String searchField,System.Int32 fieldOffset)
Member of HostFront.EAI.HostLink
Parameters
SearchField: The search field to locate.
FieldOffset: The number of fields to the right of the search field.
Returns
Returns the field value.
GetField (System.String, System.Int32, HostFront.Block.TrimOption)
Retrieves the field value located by a specified number of fields to the right of a search field with an option to trim the text value.
Prototype
public System.String GetField (System.String searchField,System.Int32 fieldOffset,HostFront.Block.TrimOption trimOption)
Member of HostFront.EAI.HostLink
Parameters
SearchField: The search field to locate.
FieldOffset: The number of fields to the right of the search field.
trimOption: Enumerator with 4 options (NoTrim, Trim, TrimEnd, TrimStart)
Returns
Returns the field value.
GetFieldColor (System.Int32 row,System.Int32 column)
Retrieves the color of a field.
Prototype
public System.Drawing.Color GetFieldColor (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns the field color.
GetFieldEditFlags (System.Int32 row,System.Int32 column)
Retrieves the edit flags of a given field. The edit values of a field are described within FieldEditFlags enum.
Prototype
public HostFront.EAI.FieldEditFlags GetFieldEditFlags (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns the edit value.
GetFieldLength (System.Int32 row,System.Int32 column)
Returns the length of a field.
Prototype
public System.Int32 GetFieldLength (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns the field length.
GetFieldStart (System.Int32 row,System.Int32 column)
Returns the starting column position of a field.
Prototype
public System.Int32 GetFieldStart (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns the starting column position.
GetFieldStatusFlags (System.Int32 row,System.Int32 column)
Get a ScreenFields class containing all the read-only fields of the specified row.
Prototype
public HostFront.EAI.ScreenFields GetReadOnlyFields ()
Member of HostFront.EAI.HostLink
Parameters
Row: The row position.
Returns
A HostFront.EAI.ScreenFields class.
GetRow(System.Int32 row)
Retrieves an entire row on the screen.
Prototype
public System.String GetRow ( System.Int32 row )
Member of HostFront.EAI.HostLink
Parameters
Row: The row position.
Returns
Returns the row data.
GetScreenField (System.Int32 row,System.Int32)
Retrieves the field located at a given row and column position.
Prototype
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position
Column: The field column position
Returns
Returns a ScreenField object representing the field.
HostFrontServerAddress
Gets the address of the HostFront server assigned to this session.
Prototype
public System.String HostFrontServerAddress [get]
Member of HostFront.EAI.HostLink
HostFrontServerPort
Gets the port number of the HostFront server (if TCP/IP) or Web server (if HTTP) assigned to this session.
Prototype
public System.Int32 HostFrontServerPort [get]
Member of HostFront.EAI.HostLink
IsConnected
Checks whether a field can be modified or not.
Prototype
public System.Boolean IsFieldEditable (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
IsFieldEditable (System.Int32 row,System.Int32 column)
Checks whether a field can be modified or not.
Prototype
public System.Boolean IsFieldEditable (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
True if field is writable, false if read only.
IsKeyboardLocked
Indicates whether the keyboard is locked.
Prototype
public bool IsKeyboardLocked [ get]
Member of HostFront.EAI.HostLink
LightPenSelect ( System.Int32 row,System.Int32 column)
Emulates a light pen selection of a given position on the screen.
Prototype
public System.Boolean LightPenSelect (System.Int32 row,System.Int32 column)
Member of HostFront.EAI.HostLink
Parameters
Row: The field row position.
Column: The field column position.
Returns
Returns true if successful. Otherwise, false.
OverrideNumericFields
Gets or sets a flag indicating whether numeric fields can receive non-numeric data.
Prototype
public System.Boolean OverrideNumericFields [get,set]
Member of HostFront.EAI.HostLink
PushKey(HostFront.EAI.Key,System.Int32)
Issues a key press command on the host. The final screen is obtained after a specified delay. Used mostly with 3270 emulation.
Prototype
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host
millisecondsDelay: The delay specified in milliseconds
Returns
Returns true if the specified time has not elapsed. Otherwise, false.
PushKey (HostFront.EAI.Key,HostFront.EAI.ScreenIdentifierSystem.Int32)
Issues a key press command on the host. Terminates when a screen field is equal to the screen identifier or when the specified time elapses.
Prototype
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host
id: The screen identifier
millisecondsTimeout: The timeout specified in milliseconds. A value of 0 indicates an infinite wait.
Returns
Returns true if the specified time has not elapsed. Otherwise, false.
PushKey (HostFront.EAI.Key, HostFront.EAI.ScreenIdentifier)
Issues a key press command on the host. Terminates when a screen field is equal to the screen identifier. Used mostly with 3270 emulation. This is an abstract method.
Prototype
public abstract virtual System.Boolean PushKey (HostFront.EAI.Key key,HostFront.EAI.ScreenIdentifier id)
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host.
id: The screen identifier.
Returns
Indicates whether the operation was successful.
PushKey (HostFront.EAI.Key)
Issues a key press command on the host.
Prototype
public abstract virtual System.Boolean PushKey (HostFront.EAI.Key key)
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host.
Returns
Indicates whether the operation was successful.
PushKey (System.Int32,System.Int32)
Issues a key press command on the host. The final screen is obtained after a specified delay. Used mostly with 3270 emulation.
Prototype
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host
millisecondsDelay: The delay specified in milliseconds.
Returns
Returns true if the specified time has not elapsed. Otherwise, false.
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier,System.Int32)
Issues a key press command on the host. Terminates when a screen field is equal to the screen identifier or when the specified time elapses.
Prototype
Member of HostFront.EAI.HostLink
Parameters
key: The value of the key to execute on the host
id: The screen identifier
millisecondsTimeout: The timeout specified in milliseconds. A value of 0 indicates an infinite wait.
Returns
Returns true if the specified time has not elapsed. Otherwise, false.
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier)
Issues a key press command on the host. Terminates when a screen field is equal to the screen identifier. Used mostly with 3270 emulation. This is an abstract method.
Prototype
public abstract virtual System.Boolean PushKey (System.Int32 key,HostFront.EAI.ScreenIdentifier id)
Member of HostFront.EAI.HostLink
Parameters
Key: The value of the key to execute on the host.
Id: The screen identifier
Returns
Returns true if successful, false otherwise.
PushKey (System.Int32)
Issues a key press command on the host. This is an abstract method.
Prototype
public abstract virtual System.Boolean PushKey (System.Int32 key)
Member of HostFront.EAI.HostLink
Parameters
Key: The value of the key to execute on the host.
Returns
Returns true if successful, false otherwise.
ScreenToString()
Dump the current screen into a string (rows are \r\n separated).
Prototype
Member of HostFront.EAI.HostLink
PutField (System.String,System.Int32,System.Int32)
Enters data into the specified field on the screen replacing what is already in it if any.
Prototype
public virtual void PutField (System.String data,System.Int32 row,System.Int32 column )
Member of HostFront.EAI.HostLink
Parameters
Data: The data to be entered.
Row: The field row position.
Column: The field column position.
PutField (System.String,System.Int32,System.Int32, System.Boolean)
Adds the data to the specified field on the screen starting at the given column position if the last boolean parameter is set to True.
Prototype
public virtual void PutField (System.String data,System.Int32 row,System.Int32 column, System.Boolean Append )
Member of HostFront.EAI.HostLink
Parameters
Data: The data to be entered.
Row: The field row position.
Column: The field column position.
Append: Append to existing field if true.
ScreenHeight
Returns the height of the screen.
Prototype
public int ScreenHeight [get]
Member of HostFront.EAI.HostLink
ScreenWidth
Returns the width of the screen.
Prototype
public int ScreenWidth [get]
Member of HostFront.EAI.HostLink
ServerVersion
Gets the version of the HostFront server.
Prototype
public Int ServerVersion [get/set]
Member of HostFront.EAI.HostLink
SessionID
Gets the session ID of the current connected session. Can be used with the Attach() or the GetSessionStatusHFEE() methods.
Prototype
public System.String SessionID [get]
Member of HostFront.EAI.HostLink
SetCursor (System.Int32,System.Int32)
Positions the cursor on the screen.
Prototype
public void SetCursor ( System.Int32 row,System.Int32 column )
Member of HostFront.EAI.HostLink
Parameters
Row: The cursor row position.
Column: The cursor column position.
SetLanguage (HostFront.EAI.Language)
This sets the language on the client and verifies that it has the same language that is set within HostFront Server. Note that this function must be called after connecting to the host.
Prototype
public System.Boolean SetLanguage (HostFront.EAI.Language language)
Parameters
language: The language to set
Returns
False. If not connected to the server or if the language does not match the setting on the server. Otherwise, returns true.
Returns true if successful, false otherwise.
Properties
The following properties are associated with the HostLink class.
ArabicFlags
Gets or sets the flags for Arabic data for proper display.
Prototype
public HostFront.EAI.ArabicFlags ArabicFlags [get, set]
Close
Closes the connection to HostFront server and terminates the session on the host. This method is abstract.
Prototype
public abstract virtual void Close ( )
Member of HostFront.EAI.HostLink
ConnectionType
Returns the type of connection to HostFront Server.
Prototype
public HostFront.EAI.ConnectionType ConnectionType [get]
Member of HostFront.EAI.HostLink
CurrentScreen ()
Get a ScreenFields class containing all the fields of the current screen
Prototype
public HostFront.EAI.ScreenFields CurrentScreen ()
Member of HostFront.EAI.HostLink
Parameters
None.
Return
A HostFront.EAI.ScreenFields class.
CursorColumn
Returns the cursor column position.
Prototype
public int CursorColumn [get]
Member of HostFront.EAI.HostLink
CursorRow
Returns the cursor row position.
Prototype
public int CursorRow [get]
Member of HostFront.EAI.HostLink
Emulation
Sets or gets the type of emulation used for the session.
Prototype
public HostFront.EAI. Emulation Emulation [get,set]
Member of HostFront.EAI.HostLink
ErrorMessage
Returns any error messages received from HostFront Server.
Prototype
public string ErrorMessage [get]
Member of HostFront.EAI.HostLink