Interfaces to represent winforms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ps81
    New Member
    • Mar 2008
    • 2

    #1

    Interfaces to represent winforms

    I am planning to make my winforms implement an interface representing
    the data on the forms.
    And the interface will be passed to a class which will contain the
    data to be populated on the winforms.I am planning to use reflection
    to the populate the winforms.
    The reason why i am doing it is to keep the separate the data classes
    and UI.
    In future I mite have to develop an asp.net Application.(al l i will
    have to do is create webforms which implemtn the interface).

    Please comment. ANd TIA

    An example of the class which contains data for the AddressForm is
    below.

    public class AddressRequest
    {

    public Address()
    {
    }

    [FormMapper("Str eetAddress")]
    public string StreetAddress { get; set; }

    [FormMapper("Add ress2")]
    public string UnitNumber { get; set; }

    [FormMapper("Cit y")]
    public string City { get; set; }

    [FormMapper("Sta te")]
    public string State { get; set; }

    [FormMapper("Zip ")]
    public string zip { get; set; }

    }

    public interface IAddresss

    {
    string StreetAddress;
    string Address2;
    string city;
    string state;
    strring zip;
    string country;
Working...