bind GUI elements to xml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharon

    bind GUI elements to xml

    hi all
    I have a small application assembled from
    C# winForm client side (few of them)
    C# webService at the server side

    I'm using xml file to transfer the GUI information from client to server
    For Example in the client window there are 3 text box's and one button
    Text boxes are "first num" , " second num" and "sum"
    And "calc" button

    So when the user click the "calc" button , the winForm window send the GUI
    xml to the server , and the server parses the xml file and fill in the
    records

    Xml example :

    <Gui_items>
    <item>
    <textbox name="first
    num">30</textbox>
    </item>
    <item>
    <textbox name="second
    num">50</textbox>
    </item>
    <item>
    <textbox
    name="sum"></textbox>
    </item>
    </Gui_items>

    the server response will be :

    <Gui_items>
    <item>
    <textbox name="first
    num">30</textbox>
    </item>
    <item>
    <textbox name="second
    num">50</textbox>
    </item>
    <item>
    <textbox
    name="sum">80</textbox>
    </item>
    </Gui_items>

    Then the winForm client get the response XML and parses it ,
    All GUI item's are filed in to the GUI controls

    This only simple example, the real client window is much complex,
    I'm using labels and label's color changing

    Currently I'm parsing the XML file using System.Xml
    Is there any way I can bind the GUI elements to this XML and make it easier
    for me to develop it ?
    Is there any way I can use dataset's and have the same goal ?

    Please post any comment you have
    Thank you very much

    Sharon


  • Chris

    #2
    Re: bind GUI elements to xml

    Sharon wrote:[color=blue]
    > hi all
    > I have a small application assembled from
    > C# winForm client side (few of them)
    > C# webService at the server side
    >
    > I'm using xml file to transfer the GUI information from client to server
    > For Example in the client window there are 3 text box's and one button
    > Text boxes are "first num" , " second num" and "sum"
    > And "calc" button
    >
    > So when the user click the "calc" button , the winForm window send the GUI
    > xml to the server , and the server parses the xml file and fill in the
    > records
    >
    > Xml example :
    >
    > <Gui_items>
    > <item>
    > <textbox name="first
    > num">30</textbox>
    > </item>
    > <item>
    > <textbox name="second
    > num">50</textbox>
    > </item>
    > <item>
    > <textbox
    > name="sum"></textbox>
    > </item>
    > </Gui_items>
    >
    > the server response will be :
    >
    > <Gui_items>
    > <item>
    > <textbox name="first
    > num">30</textbox>
    > </item>
    > <item>
    > <textbox name="second
    > num">50</textbox>
    > </item>
    > <item>
    > <textbox
    > name="sum">80</textbox>
    > </item>
    > </Gui_items>
    >
    > Then the winForm client get the response XML and parses it ,
    > All GUI item's are filed in to the GUI controls
    >
    > This only simple example, the real client window is much complex,
    > I'm using labels and label's color changing
    >
    > Currently I'm parsing the XML file using System.Xml
    > Is there any way I can bind the GUI elements to this XML and make it easier
    > for me to develop it ?
    > Is there any way I can use dataset's and have the same goal ?
    >
    > Please post any comment you have
    > Thank you very much
    >
    > Sharon
    >
    >[/color]

    If I remember correctly, you can pass object through a web service. So
    why not make a business object, load it up with the information pass it
    over. This will remove the overhead of the xml processing as well as
    the xml overhead text.

    Chris

    Comment

    Working...