Не работает Xml-сериализация: "Возникла ошибка при отражении типа." - C#
Формулировка задачи:
Добрый день! Помогите, пожалуйста, решить проблему. Вот сериализуемый объект. Ошибка ссылается на него.
public class RedBlackNode
{
public static int RED = 0;
public static int BLACK = 1;
private IComparable ordKey;
private int intColor;
// left node
private RedBlackNode rbnLeft;
// right node
private RedBlackNode rbnRight;
// parent node
private RedBlackNode rbnParent;
private int x;
private int y;
public override string ToString()
{
return this.Y.ToString();
}
[XmlAttribute()]
public int X
{
get
{
return x;
}
set
{
x = value;
}
}
[XmlAttribute()]
public int Y
{
get
{
return y;
}
set
{
y = value;
}
}
[XmlAttribute()]
public IComparable Key
{
get
{
return ordKey;
}
set
{
ordKey = value;
}
}
[XmlAttribute()]
public int Color
{
get
{
return intColor;
}
set
{
intColor = value;
}
}
[XmlAttribute()]
public RedBlackNode Left
{
get
{
return rbnLeft;
}
set
{
rbnLeft = value;
}
}
///<summary>
/// Right
///</summary>
///
[XmlAttribute()]
public RedBlackNode Right
{
get
{
return rbnRight;
}
set
{
rbnRight = value;
}
}
[XmlAttribute()]
public RedBlackNode Parent
{
get
{
return rbnParent;
}
set
{
rbnParent = value;
}
}
public RedBlackNode()
{
Color = RED;
}
}Решение задачи: «Не работает Xml-сериализация: "Возникла ошибка при отражении типа."»
textual
Листинг программы
public class SerializableObject
{
private ArrayList Content = new ArrayList();
[XmlArray]
[XmlArrayItem(typeof(RedBlackNode))]
public IList Cont
{
get
{
return Content;
}
}
public SerializableObject() { }
}