public bool SetSettings(ViewDocGeneratorSettings settings) { if (settings == null || !settings.Valid()) { return(false); } _settings = settings; _hasSerializers = _settings.Serializers != null && _settings.Serializers.Any(); var descriptionGeneratorSettings = new ViewDescriptionGeneratorSettings { TypeNameFunc = _settings.TypeNameFunc, AdditionalChecksHeaderPattern = _settings.AdditionalChecksHeaderPattern }; return(_descriptionGenerator.SetSettings(descriptionGeneratorSettings)); }
private bool TrySetViewDocGeneratorSettings(IEnumerable <IExampleSerializer> serializers) { var settings = new ViewDocGeneratorSettings { Serializers = serializers, NoPropertyContractPattern = NoPropertyContractPattern, NoPropertyDescriptionPattern = NoPropertyDescriptionPattern, NoExampleAvailablePattern = NoExampleAvailablePattern, ExampleStartPattern = ExampleStartPattern, ExampleEndPattern = ExampleEndPattern, ExamplesHeaderPattern = ExamplesHeaderPattern, DescriptionAndRestrictionsPattern = DescriptionAndRestrictionsPattern, TypeNameFunc = type => GetSimpleTypeName(type), AdditionalChecksHeaderPattern = AdditionalChecksHeaderPattern }; return(_viewDocGenerator.SetSettings(settings)); }