Esempio n. 1
0
 private void VisitYamlMappingNode(YamlDotNet.RepresentationModel.YamlMappingNode node)
 {
     foreach (System.Collections.Generic.KeyValuePair <
                  YamlDotNet.RepresentationModel.YamlNode, YamlDotNet.RepresentationModel.YamlNode
                  > yamlNodePair in node.Children)
     {
         VisitYamlNodePair(yamlNodePair);
     }
 }
Esempio n. 2
0
        private void VisitYamlMappingNode(string context, YamlDotNet.RepresentationModel.YamlMappingNode yamlValue)
        {
            //a node with an associated sub-document
            EnterContext(context);

            VisitYamlMappingNode(yamlValue);

            ExitContext();
        }
Esempio n. 3
0
        public System.Collections.Generic.IDictionary <string, string> Parse(
            System.IO.Stream input)
        {
            _data.Clear();
            _context.Clear();

            // https://dotnetfiddle.net/rrR2Bb
            YamlDotNet.RepresentationModel.YamlStream yaml = new YamlDotNet.RepresentationModel.YamlStream();
            yaml.Load(new System.IO.StreamReader(input, detectEncodingFromByteOrderMarks: true));


            foreach (YamlDotNet.RepresentationModel.YamlDocument doc in yaml.Documents)
            {
                YamlDotNet.RepresentationModel.YamlMappingNode mapping =
                    (YamlDotNet.RepresentationModel.YamlMappingNode)doc.RootNode;

                // The document node is a mapping node
                VisitYamlMappingNode(mapping);
            }

            return(_data);
        }