Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DynamicYamlScalar.cs
Go to the documentation of this file.
1 using System;
2 using System.Dynamic;
3 using SharpYaml.Serialization;
4 
5 namespace SiliconStudio.Core.Yaml
6 {
7  /// <summary>
8  /// Dynamic version of <see cref="YamlScalarNode"/>.
9  /// </summary>
11  {
12  internal YamlScalarNode node;
13 
14  public YamlScalarNode Node
15  {
16  get
17  {
18  return node;
19  }
20  }
21 
22  public DynamicYamlScalar(YamlScalarNode node)
23  {
24  this.node = node;
25  }
26 
27  public override bool TryConvert(ConvertBinder binder, out object result)
28  {
29  result = Convert.ChangeType(node.Value, binder.Type);
30  return true;
31  }
32  }
33 }
override bool TryConvert(ConvertBinder binder, out object result)
Dynamic version of YamlScalarNode.