Exemplo n.º 1
0
        private string StringValue(YamlNode node)
        {
            var visitor = new StringValueVisitor();

            node.Accept(visitor);
            return(visitor.Value);
        }
Exemplo n.º 2
0
 protected override void VisitPair(YamlNode key, YamlNode value)
 {
     key.Accept(this);
     _path.Push(_buffer.Pop().ToString());
     value.Accept(this);
     if (_buffer.Any())
     {
         SaveData();
     }
     _path.Pop();
 }
Exemplo n.º 3
0
        private void Visit(YamlNode node, string path)
        {
            var visitor = Visitors.FirstOrDefault(x => YamlPathMatch(x.ExpectedYPath, path));

            if (visitor == null)
            {
                throw new UnknownNodeException(path);
            }

            visitor.Spec       = Spec;
            visitor.Visitors   = Visitors;
            visitor.ActualPath = path;
            try
            { node.Accept(visitor); }
            catch (YamlProcessingException)
            { throw; }
            catch (Exception ex)
            {
                throw new YamlProcessingException(path, ex);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Called when this object is visiting a key-value pair.
 /// </summary>
 /// <param name="key">The left (key) <see cref="YamlNode"/> that is being visited.</param>
 /// <param name="value">The right (value) <see cref="YamlNode"/> that is being visited.</param>
 protected virtual void VisitPair(YamlNode key, YamlNode value)
 {
     key.Accept(this);
     value.Accept(this);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Called when this object is visiting a key-value pair.
 /// </summary>
 /// <param name="key">The left (key) <see cref="YamlNode"/> that is being visited.</param>
 /// <param name="value">The right (value) <see cref="YamlNode"/> that is being visited.</param>
 protected virtual void VisitPair(YamlNode key, YamlNode value)
 {
     key.Accept(this);
     value.Accept(this);
 }
Exemplo n.º 6
0
 protected override void VisitPair(YamlNode key, YamlNode value)
 {
     EnterContext(key as YamlScalarNode);
     value.Accept(this);
     ExitContext();
 }