Exemplo n.º 1
0
        private bool TryGetValueByYamlKeyAndType(YamlScalarNode yamlKey, Type type, out object result)
        {
            if (mappingNode.Children.ContainsKey(yamlKey))
            {
                var value = mappingNode.Children[yamlKey];
                if (YamlDoc.TryMapValue(value, out result))
                {
                    return(true);
                }
            }

            return(FailToGetValue(out result));
        }
Exemplo n.º 2
0
        private bool TryGetValueByIndex(int index, out object result)
        {
            if (sequenceNode == null)
            {
                return(FailToGetValue(out result));
            }

            if (index >= sequenceNode.Count())
            {
                throw new IndexOutOfRangeException();
            }

            return(YamlDoc.TryMapValue(sequenceNode.ToArray()[index], out result));
        }
Exemplo n.º 3
0
 public DynamicYaml(string yaml)
     : this(YamlDoc.LoadFromString(yaml))
 {
 }
Exemplo n.º 4
0
 public DynamicYaml(TextReader reader)
     : this(YamlDoc.LoadFromTextReader(reader))
 {
 }
Exemplo n.º 5
0
 public void Reload(string yaml)
 {
     Reload(YamlDoc.LoadFromString(yaml));
 }
Exemplo n.º 6
0
 public void Reload(TextReader reader)
 {
     Reload(YamlDoc.LoadFromTextReader(reader));
 }