예제 #1
0
        private bool TryGetValueByYamlKey(YamlScalarNode yamlKey, out object result)
        {
            if (_mappingNode.Children.ContainsKey(yamlKey))
            {
                YamlNode value = _mappingNode.Children[yamlKey];
                if (YamlDoc.TryMapValue(value, out result))
                {
                    return(true);
                }
            }

            return(FailToGetValue(out result));
        }
예제 #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));
        }
예제 #3
0
 public DynamicYaml(string yaml)
     : this(YamlDoc.LoadFromString(yaml))
 {
 }
예제 #4
0
 public DynamicYaml(TextReader reader)
     : this(YamlDoc.LoadFromTextReader(reader))
 {
 }
예제 #5
0
 public void Reload(string yaml)
 {
     Reload(YamlDoc.LoadFromString(yaml));
 }
예제 #6
0
 public void Reload(TextReader reader)
 {
     Reload(YamlDoc.LoadFromTextReader(reader));
 }