예제 #1
0
        public void ImmediateCircularReferenceDetection()
        {
            var context  = new ExportContext();
            var exporter = new ComponentExporter(typeof(Thing));

            context.Register(exporter);
            var thing = new Thing();

            thing.Other = thing;
            exporter.Export(context, thing, new EmptyJsonWriter());
        }
예제 #2
0
 public void DeepCircularReferenceDetection()
 {
     ExportContext context = new ExportContext();
     ComponentExporter exporter = new ComponentExporter(typeof(Thing));
     context.Register(exporter);
     Thing thing = new Thing();
     thing.Other = new Thing();
     thing.Other.Other = new Thing();
     thing.Other.Other.Other = thing;
     exporter.Export(context, thing, new EmptyJsonWriter());
 }
예제 #3
0
 public void CircularReferenceDetectionAcrossTypes()
 {
     ExportContext context = new ExportContext();
     ComponentExporter exporter = new ComponentExporter(typeof(Parent));
     context.Register(exporter);
     context.Register(new ComponentExporter(typeof(ParentChild)));
     Parent parent = new Parent();
     parent.Child = new ParentChild();
     parent.Child.Parent = parent;
     exporter.Export(context, parent, new EmptyJsonWriter());
 }
예제 #4
0
        public void CircularReferenceDetectionAcrossTypes()
        {
            ExportContext     context  = new ExportContext();
            ComponentExporter exporter = new ComponentExporter(typeof(Parent));

            context.Register(exporter);
            context.Register(new ComponentExporter(typeof(ParentChild)));
            Parent parent = new Parent();

            parent.Child        = new ParentChild();
            parent.Child.Parent = parent;
            exporter.Export(context, parent, new EmptyJsonWriter());
        }
예제 #5
0
        public void DeepCircularReferenceDetection()
        {
            ExportContext     context  = new ExportContext();
            ComponentExporter exporter = new ComponentExporter(typeof(Thing));

            context.Register(exporter);
            Thing thing = new Thing();

            thing.Other             = new Thing();
            thing.Other.Other       = new Thing();
            thing.Other.Other.Other = thing;
            exporter.Export(context, thing, new EmptyJsonWriter());
        }
예제 #6
0
            public void Export(ExportContext context, JsonWriter writer)
            {
                var exporter = new ComponentExporter(typeof(Point), _componentType);

                exporter.Export(new ExportContext(), this, writer);
            }
예제 #7
0
 public void Export(ExportContext context, JsonWriter writer)
 {
     ComponentExporter exporter = new ComponentExporter(typeof(Point), _componentType);
     exporter.Export(new ExportContext(), this, writer);
 }