/// <summary>
 /// Creates a new <see cref="IValueDeserializer" /> that implements the current configuration.
 /// This method is available for advanced scenarios. The preferred way to customize the bahavior of the
 /// deserializer is to use the <see cref="Build" /> method.
 /// </summary>
 public IValueDeserializer BuildValueDeserializer()
 {
     return(new AliasValueDeserializer(
                new NodeValueDeserializer(
                    nodeDeserializerFactories.BuildComponentList(),
                    nodeTypeResolverFactories.BuildComponentList()
                    )
                ));
 }
            public void SerializeValue(IEmitter emitter, object value, Type type)
            {
                var actualType = type != null ? type : value != null?value.GetType() : typeof(object);

                var staticType = type ?? typeof(object);

                var graph = new ObjectDescriptor(value, actualType, staticType);

                var preProcessingPhaseObjectGraphVisitors = preProcessingPhaseObjectGraphVisitorFactories.BuildComponentList(typeConverters);

                foreach (var visitor in preProcessingPhaseObjectGraphVisitors)
                {
                    traversalStrategy.Traverse(graph, visitor, null);
                }

                ObjectSerializer nestedObjectSerializer = (v, t) => SerializeValue(emitter, v, t);

                var emittingVisitor = emissionPhaseObjectGraphVisitorFactories.BuildComponentChain(
                    new EmittingObjectGraphVisitor(eventEmitter),
                    inner => new EmissionPhaseObjectGraphVisitorArgs(inner, eventEmitter, preProcessingPhaseObjectGraphVisitors, typeConverters, nestedObjectSerializer)
                    );

                traversalStrategy.Traverse(graph, emittingVisitor, emitter);
            }
 protected IEnumerable <IYamlTypeConverter> BuildTypeConverters()
 {
     return(typeConverterFactories.BuildComponentList());
 }