A
Albert Jan
Hi,
This must be easy, but I can't find an example:
I want to automatically serialize an element with an attribute like the
following
<ClientSoftware version="(254)">MySoftware</ClientSoftware>
to a C# class.
If 'Clientsoftware' has child elements I can use something like the code
given below , but I don't know how to do this when the element has simple
content.
I appreciate any help on this subject,
Albert Jan
using System;
using System.Xml.Serialization;
namespace myns
{
public class ClientSoftwareType
{
virtual public System.String Name
{
get
{
return name
}
set
{
name = value;
}
}
[XmlAttribute ("version")]
virtual public System.String Version
{
get
{
return version;
}
set
{
this.version = value;
}
}
private System.String name;
private System.String version;
}
}
This must be easy, but I can't find an example:
I want to automatically serialize an element with an attribute like the
following
<ClientSoftware version="(254)">MySoftware</ClientSoftware>
to a C# class.
If 'Clientsoftware' has child elements I can use something like the code
given below , but I don't know how to do this when the element has simple
content.
I appreciate any help on this subject,
Albert Jan
using System;
using System.Xml.Serialization;
namespace myns
{
public class ClientSoftwareType
{
virtual public System.String Name
{
get
{
return name
}
set
{
name = value;
}
}
[XmlAttribute ("version")]
virtual public System.String Version
{
get
{
return version;
}
set
{
this.version = value;
}
}
private System.String name;
private System.String version;
}
}