
Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
> <snip>
>
[quoted text clipped - 6 lines]
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk
I dont have currently working code. I have been recommended to use
XSD.exe to generate the code instead of typing it in.
The auto generated code should have custom attributes (in my example
it its FormMapper)
public class Address
{
public Address()
{
}
[FormMapper("TextBox2")]
public string StreetAddress { get; set; }
[FormMapper("TextBox3")]
public string UnitNumber { get; set; }
[FormMapper("TextBox4")]
public string City { get; set; }
[FormMapper("TextBox5")]
public string State { get; set; }
[FormMapper("TextBox6")]
public string zip { get; set; }
}
What I am trying to do is.
I have to send XML requests to the server based on the events on my
winform applications. They could add/update/get requests. I will have
70-80 different requests types and hence 70-80 XSDs (or Classes) to
maintain.
I am planning to use reflection to populate fields on the winforms
using the FormMapper attribute.But that may not be the only reason why
i need custom attributes. I mite also need to get someinfo about the
fields(like readonly, enabled ) etc from the server.
TIA
Marc Gravell - 04 Mar 2008 08:04 GMT
The problem is that xsd (either the format or the exe) isn't going to be in
the least bit interested in your attribute. Of couse, having your object
model dictate the UI also might not be the best idea... personally I'd
separate the two concepts completely, perhaps using xml generation if (and
only if) it made sense.
Marc
parez - 04 Mar 2008 20:52 GMT
> The problem is that xsd (either the format or the exe) isn't going to be in
> the least bit interested in your attribute. Of couse, having your object
[quoted text clipped - 3 lines]
>
> Marc
Hi Marc,
I finally have a custom code generator which geneerates the
Attributes...
I am using the XSD to create classes because the server is going to
use the same XSD to process my request.
My classes are not part of the business tier. They are a part of the
presentation layer(well.. its sits between the winforms and Server).
I am planning to use reflection to populate the form fields.Thats why
I am using the FormMapper Attribute.