请教XML序列化与反序列化的有关问题

[Serializable] public class Family { public Family() { } public Husband Male { get; set; } public Wife Female { get; set; } } [Serializable] public class Husband { public Wife Wife { get; set; } } [Serializable] public class Wife { public Husband Husband { get; set; } }

我需要对Family进行序列化和反序列化操作,但出现了类交叉使用的情况,该如何来解决该问题?谢谢!!

------解决方案--------------------
什么是序列化和反序列化
------解决方案--------------------
明白楼主的意思,但是好像没碰到过这样的事情 -->
请问XML序列化与反序列化的问题
假定有如下类:
C# code

[Serializable]
public class Family
{
    public Family()
    {
    }

    public Husband Male
    {
        get;
        set;
    }

    public Wife Female
    {
        get;
        set;
    }
}

[Serializable]
public class Husband
{
    public Wife Wife
    {
        get;
        set;
    }
}

[Serializable]
public class Wife
{
    public Husband Husband
    {
        get;
        set;
    }
}



我需要对Family进行序列化和反序列化操作,但出现了类交叉使用的情况,该如何来解决该问题?谢谢!!

------解决方案--------------------
什么是序列化和反序列化
------解决方案--------------------
明白楼主的意思,但是好像没碰到过这样的事情