Пример #1
0
        static void EmitTest(YDocument doc)
        {
            doc = doc ?? new YDocument(
                new YMapping(new Dictionary <YScalar, YNode> {
                { "x", new YSequence(new YScalar("a"), new YScalar("b")) },
                { "y", new YMapping(new Dictionary <YScalar, YNode> {
                        { "f", new YSequence(new YScalar("g"), new YScalar("h")) },
                        { "i", new YScalar("jk") }
                    }) },
            })
                );
            string yaml = Yaml.Dump(doc);

            Console.WriteLine(yaml);
        }
Пример #2
0
        private static void AliasTest()
        {
            var repeatNode = new YMapping(new Dictionary <YScalar, YNode> {
                { "f", new YSequence(new YScalar("g"), new YScalar("h")) },
                { "i", new YScalar("jk") }
            });
            var doc = new YDocument(
                new YMapping(new Dictionary <YScalar, YNode> {
                { "x", new YSequence(new YScalar("a"), new YScalar("b"), repeatNode) },
                { "y", repeatNode },
                { "z", repeatNode }
            })
                );
            string yaml = Yaml.Dump(doc);

            Console.WriteLine(yaml);
        }