예제 #1
0
        /// <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>();
            }
        }
예제 #2
0
 /// <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));
 }
예제 #3
0
 /// <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)
 {
 }
예제 #4
0
 /// <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;
 }