YamlValue class
Represents a mutable YAML value.
Namespace: System.Text.Yaml.Nodes · Assembly: Styml.dll
public abstract class YamlValue : YamlNode
Inheritance: object → YamlNode → YamlValue
Represents a mutable YAML value.
MethodsLink to this heading
CreateLink to this heading
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(bool value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(bool? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(byte value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(byte? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(char value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(char? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(DateTime value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(DateTime? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(DateTimeOffset value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(DateTimeOffset? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(decimal value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(decimal? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(double value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(double? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(Guid value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(Guid? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(short value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(short? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(int value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(int? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(long value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(long? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(sbyte value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(sbyte? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(float value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(float? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(string? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(ushort value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(ushort? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(uint value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(uint? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue Create(ulong value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(ulong? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(YamlElement value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create(YamlElement? value, YamlNodeOptions? options = null);
Parameters
value: The underlying value of the newYamlValueinstance.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create<T>(T? value, YamlNodeOptions? options = null);
Type parameters
T: The type of value to create.
Parameters
value: The value to create.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
Initializes a new instance of the YamlValue class that contains the specified value.
public static YamlValue? Create<T>(T? value, YamlTypeInfo<T?> yamlTypeInfo, YamlNodeOptions? options = null);
Type parameters
T: The type of value to create.
Parameters
value: The value to create.yamlTypeInfo: TheYamlTypeInfothat will be used to serialize the value.options: Options to control the behavior.
Returns: The new instance of the YamlValue class that contains the specified value.
TryGetValueLink to this heading
Tries to obtain the current YAML value and returns a value that indicates whether the operation succeeded.
public abstract bool TryGetValue<T>(out T? value);
Type parameters
T: The type of value to obtain.
Parameters
value: When this method returns, contains the parsed value.
Returns: true if the value can be successfully obtained; otherwise, false.
can be the type or base type of the underlying value. If the underlying value is a YamlElement then can also be the type of any primitive value supported by current YamlElement. Specifying the Object type for will always succeed and return the underlying value as Object.
The underlying value of a YamlValue after deserialization is an instance of YamlElement, otherwise it's the value specified when the YamlValue was created.