|
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
namespace XmlSerializersTest.Samples
{
[Title("Object graph with cycle")]
[SkipSerializer("Standard", "Object graph with cycle causes unrecoverable stack overflow")]
[SkipSerializer("XAML", "Object graph with cycle causes unrecoverable stack overflow")]
public class ObjectGraphWithCycle
{
public string Value { get; set; }
[XmlIgnore]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public List<ObjectGraphWithCycle> Links { get; set; }
public static ObjectGraphWithCycle GetSampleGraphWithCycle()
{
var node = new ObjectGraphWithCycle { Value = "root" };
node.Links = new List<ObjectGraphWithCycle> {node};
return node;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.
Please visit my web site:
www.ikriv.com.