private IObjectGraphTraversalStrategy CreateTraversalStrategy() { ITypeInspector typeDescriptor = new ReadablePropertiesTypeInspector(typeResolver); if (IsOptionSet(SerializationOptions.Roundtrip)) { typeDescriptor = new ReadableAndWritablePropertiesTypeInspector(typeDescriptor); } typeDescriptor = new YamlAttributeOverridesInspector(typeDescriptor, overrides); typeDescriptor = new YamlAttributesTypeInspector(typeDescriptor); typeDescriptor = new NamingConventionTypeInspector(typeDescriptor, namingConvention); if (IsOptionSet(SerializationOptions.DefaultToStaticType)) { typeDescriptor = new CachedTypeInspector(typeDescriptor); } if (IsOptionSet(SerializationOptions.Roundtrip)) { return(new RoundtripObjectGraphTraversalStrategy(Converters, typeDescriptor, typeResolver, 50)); } else { return(new FullObjectGraphTraversalStrategy(typeDescriptor, typeResolver, 50, namingConvention)); } }
private IObjectGraphTraversalStrategy CreateTraversalStrategy() { ITypeInspector innerTypeDescriptor = new ReadablePropertiesTypeInspector(this.typeResolver); if (this.IsOptionSet(SerializationOptions.Roundtrip)) { innerTypeDescriptor = new ReadableAndWritablePropertiesTypeInspector(innerTypeDescriptor); } innerTypeDescriptor = new YamlAttributesTypeInspector(new YamlAttributeOverridesInspector(new NamingConventionTypeInspector(innerTypeDescriptor, this.namingConvention), this.overrides)); if (this.IsOptionSet(SerializationOptions.DefaultToStaticType)) { innerTypeDescriptor = new CachedTypeInspector(innerTypeDescriptor); } return(!this.IsOptionSet(SerializationOptions.Roundtrip) ? new FullObjectGraphTraversalStrategy(this, innerTypeDescriptor, this.typeResolver, 50, this.namingConvention) : new RoundtripObjectGraphTraversalStrategy(this, innerTypeDescriptor, this.typeResolver, 50)); }
private IObjectGraphTraversalStrategy CreateTraversalStrategy() { ITypeInspector typeDescriptor = new ReadablePropertiesTypeInspector(typeResolver); if (IsOptionSet(SerializationOptions.Roundtrip)) { typeDescriptor = new ReadableAndWritablePropertiesTypeInspector(typeDescriptor); } typeDescriptor = new NamingConventionTypeInspector(typeDescriptor, namingConvention); typeDescriptor = new YamlAttributesTypeInspector(typeDescriptor); if (IsOptionSet(SerializationOptions.Roundtrip)) { return new RoundtripObjectGraphTraversalStrategy(this, typeDescriptor, typeResolver, 50); } else { return new FullObjectGraphTraversalStrategy(this, typeDescriptor, typeResolver, 50, namingConvention); } }