/// <summary> /// Initializes a new instance of the <see cref="YamlSerializer"/> class. /// </summary> /// <param name="serializedType">Type of the serialized.</param> /// <param name="mode">The options the specify the behavior of the serializer.</param> public YamlSerializer(Type serializedType, YamlSerializerModes mode) { this.serializedType = serializedType; this.mode = mode; if (!DisableAliases) { anchors = new Dictionary <object, ObjectInfo>(); } }
/// <summary> /// Creates a new instance of <see cref="YamlSerializer{TSerialized}"/>. /// </summary> /// <typeparam name="TSerialized">The type of the serialized.</typeparam> /// <param name="serialized">An object of the serialized type. This parameter is necessary to allow type inference.</param> /// <param name="mode">The mode.</param> /// <returns></returns> public static YamlSerializer <TSerialized> Create <TSerialized>(TSerialized serialized, YamlSerializerModes mode) { return(new YamlSerializer <TSerialized>(mode)); }
/// <summary> /// Initializes a new instance of the <see cref="YamlSerializer"/> class. /// </summary> /// <param name="mode">The options the specify the behavior of the serializer.</param> /// <remarks> /// When deserializing, the stream must contain type information for the root element. /// </remarks> public YamlSerializer(YamlSerializerModes mode) : this(typeof(object), mode) { }
/// <summary> /// Initializes a new instance of the <see cref="YamlSerializer"/> class. /// </summary> /// <param name="serializedType">Type of the serialized.</param> /// <param name="mode">The options the specify the behavior of the serializer.</param> public YamlSerializer(Type serializedType, YamlSerializerModes mode) { this.serializedType = serializedType; this.mode = mode; }