In the "RGA" iPhone view, section 6 has a textEntry controller. a textfield(1, above) for you to enter a text message to sent to a textBox(2, below) in the RGA Example.exe or vice versa.
Now, you will learn how to recreate this controller in "myRGA" iPhone view.
Right click the "view" node then select "add section." Right click the "title" node of the new "section" node and enter "Sent Message" in the pop-up.
Find the "row" node under the new section and right click "controller" node. Select "add textEntry" from the options.
Right click the "placeHolder" and enter "[Enter Text Message for PC]." The place holder message will appear as default text by default prior to any message has been sent or received.
Right click the "keyboardType" node and select "default." Apple iPhone OS offers several keyboard types as sown below:
To connect the textEntry to the "Remote Message" textBox in RGA example.exe, right click the "source.dataName" node (4), then select "Remote Message" from the pull-down list.
Open Form1.cs in the RGA Example Visual Studio project and double click the textBox (1, figure above). It should jump to the following code:
private void textBox1_TextChanged(object sender, EventArgs e)
{
INFOMATO.WCF.DataExchangeService.servicePostData("RGA", "Remote Message",
textBox_remoteMessage.Text);
}
Every time the textBox (named textBox_remoteMessage) value changes, the above function is executed. We call up the function INFOMATO.WCF.DataExchangeService.servicePostData to inform iQuipment PC to update the value for "Remote Message" in "RGA" view.
Similar to the handling of the segments control, when you tap the "Done" key on your iPhone, it will trigger the event INFOMATO.WCF.DataExchangeService.clientSetDataEvent which, in turn, calls up DataExchangeService_clientSetDataEvent for event handling.
void DataExchangeService_clientSetDataEvent(string viewName, string dataName, object dataValue)
{
if (viewName.ToLower() == "RGA".ToLower())
{
switch (dataName.ToLower())
{
...
case "remote message":
this.UpdateTextGUIObject(this.textBox_remoteMessage, dataValue.ToString());
break;
...
}
}
}
In the UpdateTextGUIObject function call, we took care of UI thread-safe issues when updating the textBox value. Windows UI thread-safe coding is discussed in greater detail in the section on segments controllers.