public void TestMethod1() { var a = YAMLDocument.WriteMappingsSequence( typeof(TestMethod1_Type), new TestMethod1_Type { Field1 = "1", Field2 = "2" }, new TestMethod1_Type { Field1 = "3", Field2 = "4" } ); var t = new TextField { multiline = true, text = a, width = 400, height = 400 }.AttachTo(this); var n = (TestMethod1_Type[]) YAMLDocument.FromMappingsSequence( typeof(TestMethod1_Type), a ); Trace.Assert(n[0].Field1 == "1"); Trace.Assert(n[0].Field2 == "2"); Trace.Assert(n[1].Field1 == "3"); Trace.Assert(n[1].Field2 == "4"); }
public void TestMethod1() { var a = YAMLDocument.WriteMappingsSequence( typeof(TestMethod1_Type), new TestMethod1_Type { Field1 = "1", Field2 = "2" }, new TestMethod1_Type { Field1 = "3", Field2 = "4" } ); Console.WriteLine(a); var n = (TestMethod1_Type[]) YAMLDocument.FromMappingsSequence( typeof(TestMethod1_Type), a ); Trace.Assert(n[0].Field1 == "1"); Trace.Assert(n[0].Field2 == "2"); Trace.Assert(n[1].Field1 == "3"); Trace.Assert(n[1].Field2 == "4"); }
public static string ToYAML(this GameReference[] a) { return(YAMLDocument.WriteMappingsSequence(typeof(GameReference), a)); }