T
Torsten Z
Hi,
how can I create an object to get the following XML by serialization
<ServiceHost>
<HostId>cdf87f74-d15c-44a1-9c77-c03c2c5c1588</HostId>
<ScreenIds>
<ScreenId>f8b0ccba-4c6e-4f05-b1f3-f82c8107e70f</ScreenId>
<ScreenId>5d136051-1bb5-4ce8-bb7c-d1369647cd0e</ScreenId>
</ScreenIds>
</ServiceHost>
I have the following code and get <string> instead of <ScreenId>. Is there
any posibility to get <ScreenId>?
public class ServiceHost
{
private string hostId;
private ScreenIDs screenIds;
public ServiceHost()
{
}
public string HostId
{
get
{
return this.hostId;
}
set
{
this.hostId = value;
}
}
public ScreenIDs ScreenIds
{
get
{
return this.screenIds;
}
set
{
this.screenIds = value;
}
}
}
public class ScreenIDs : System.Collections.CollectionBase
{
public ScreenIDs()
: base()
{
}
#region Public Properties
public string this[int index]
{
get
{
return (string)(this.InnerList[index]);
}
set
{
this.InnerList[index] = value;
}
}
#endregion
#region Public Methods
public void Add(string item)
{
this.InnerList.Add(item);
}
public void Remove(string item)
{
this.InnerList.Remove(item);
}
public void Change(string oldItem, string newItem)
{
this.InnerList.Remove(oldItem);
this.InnerList.Add(newItem);
}
#endregion
}
how can I create an object to get the following XML by serialization
<ServiceHost>
<HostId>cdf87f74-d15c-44a1-9c77-c03c2c5c1588</HostId>
<ScreenIds>
<ScreenId>f8b0ccba-4c6e-4f05-b1f3-f82c8107e70f</ScreenId>
<ScreenId>5d136051-1bb5-4ce8-bb7c-d1369647cd0e</ScreenId>
</ScreenIds>
</ServiceHost>
I have the following code and get <string> instead of <ScreenId>. Is there
any posibility to get <ScreenId>?
public class ServiceHost
{
private string hostId;
private ScreenIDs screenIds;
public ServiceHost()
{
}
public string HostId
{
get
{
return this.hostId;
}
set
{
this.hostId = value;
}
}
public ScreenIDs ScreenIds
{
get
{
return this.screenIds;
}
set
{
this.screenIds = value;
}
}
}
public class ScreenIDs : System.Collections.CollectionBase
{
public ScreenIDs()
: base()
{
}
#region Public Properties
public string this[int index]
{
get
{
return (string)(this.InnerList[index]);
}
set
{
this.InnerList[index] = value;
}
}
#endregion
#region Public Methods
public void Add(string item)
{
this.InnerList.Add(item);
}
public void Remove(string item)
{
this.InnerList.Remove(item);
}
public void Change(string oldItem, string newItem)
{
this.InnerList.Remove(oldItem);
this.InnerList.Add(newItem);
}
#endregion
}