J
jw56578
What do i need to add to my class so that the ArrayList the holds a
collection of my class will serialize properly.
heres my class
[System.Xml.Serialization.XmlInclude(typeof(Card))]
public struct Card
{
private int numbericvalue;
private CardDeck.Suits suit;
private CardDeck.Types type;
public CardDeck.Suits Suit
{
set
{
suit = value;
}
get
{
return suit;
}
}
public CardDeck.Types Type
{
set
{
type = value;
}
get
{
return type;
}
}
}
I create an ArrayList, add the class to the ArrayList and try to call
XmlSerializer.Serialiaze(myArrayList);
i recieve this error:
The type Card
was not expected.
Use the XmlInclude or SoapInclude
attribute to specify types that are not known statically
what else do i have to add to my Card class so that it will work
collection of my class will serialize properly.
heres my class
[System.Xml.Serialization.XmlInclude(typeof(Card))]
public struct Card
{
private int numbericvalue;
private CardDeck.Suits suit;
private CardDeck.Types type;
public CardDeck.Suits Suit
{
set
{
suit = value;
}
get
{
return suit;
}
}
public CardDeck.Types Type
{
set
{
type = value;
}
get
{
return type;
}
}
}
I create an ArrayList, add the class to the ArrayList and try to call
XmlSerializer.Serialiaze(myArrayList);
i recieve this error:
The type Card
was not expected.
Use the XmlInclude or SoapInclude
attribute to specify types that are not known statically
what else do i have to add to my Card class so that it will work