Working with XmlVirtual

Top  Previous  Next

The XmlVirtual component allows you to create a simulated host application (no real connection needed) by combining XML-screen files and code to drive the screen navigation.

 

This component acts like a telnet component and interacts with the other TN Bridge Host Integration Pack emulation components in that way.

 

You can generate the XML-screen files using Development Lab.

 

XmlVirtual component usage can be seen in the following code snippet, which supposes a Form with a Display and a XmlVirtual components and two xml files in the same directory:

 

 VB.NET:

 Private Sub Form_Load(sender As System.Object, eventArgs As System.EventArgs)

        ' associate the XmlVirtual component instance to the Telnet property of the Display component

        tnDisplay1.Telnet = xmlVirtual1

        xmlVirtual1.StartFileName = "start.xml"

        ' when calling Connect method the StartFilename property will be used

        ' to provide the content for the first screen

        xmlVirtual1.Connect()

 End Sub

 

 Private Sub xmlVirtual1_OnNewScreen(eventSender As System.Object, eventArgs As System.EventArgs)

        ' when this event is fired, you can analize EditFields and AidKey to determine

        ' the next screen you should load using LoadScreen method

        xmlVirtual1.LoadScreen("next.xml")

 End Sub

 

 C#:

 private void Form_Load(object sender, System.EventArgs e)

 {

        // associate the XmlClient component instance to the Telnet property of the Display component

        tnDisplay1.Telnet = xmlVirtual1;

        xmlVirtual1.StartFileName = "start.xml";

        // when calling Connect method the StartFilename property will be used

        // to provide the content for the first screen

        xmlVirtual1.Connect();

 }

 

 private void xmlVirtual1_OnNewScreen(object source, System.EventArgs act)

 {

        // when this event is fired, you can analize EditFields and AidKey to determine

        // the next screen you should load using LoadScreen method

        xmlVirtual1.LoadScreen("next.xml");

 }