コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }