예제 #1
0
        public SignatureCache(DocumentModel model, UrlResolver resolver)
        {
            _resolver = resolver;

            _documentedTypes = new ConcurrentDictionary<DocumentedType, TypeSignature>(new DocumentedTypeComparer());
            _typeReferences = new ConcurrentDictionary<TypeReference, TypeSignature>(new TypeReferenceComparer());
            _documentedMethods = new ConcurrentDictionary<DocumentedMethod, MethodSignature>(new DocumentedMethodComparer());

            foreach (var @namespace in model.Assemblies.SelectMany(a => a.Namespaces))
            {
                foreach (var type in @namespace.Types)
                {
                    var typeSignature = type.Definition.GetTypeSignature(_resolver);
                    _documentedTypes.TryAdd(type, typeSignature);
                    _typeReferences.TryAdd(type.Definition, typeSignature);

                    foreach (var method in type.Methods
                        .Concat(type.Constructors)
                        .Concat(type.Operators))
                    {
                        var methodSignature = method.Definition.GetMethodSignature(_resolver);
                        _documentedMethods.TryAdd(method, methodSignature);
                    }
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SyntaxRenderer"/> class.
 /// </summary>
 /// <param name="resolver">The resolver.</param>
 /// <param name="signatureResolver">The signature service.</param>
 /// <param name="renderer">The renderer.</param>
 /// <param name="urlResolver">The URL resolver.</param>
 public SyntaxRenderer(
     DocumentModelResolver resolver,
     SignatureCache signatureResolver,
     SignatureRenderer renderer,
     UrlResolver urlResolver)
 {
     _resolver = resolver;
     _signatureResolver = signatureResolver;
     _renderer = renderer;
     _urlResolver = urlResolver;
 }
예제 #3
0
 public ApiServices(
     DocumentModel model,
     DocumentModelResolver documentModelResolver,
     UrlResolver urlResolver,
     SignatureRenderer signatureRenderer,
     LanguageProvider languageProvider,
     SyntaxRenderer syntaxRenderer,
     SignatureCache signatureResolver)
 {
     Model = model;
     ModelResolver = documentModelResolver;
     UrlResolver = urlResolver;
     SignatureRenderer = signatureRenderer;
     LanguageProvider = languageProvider;
     SyntaxRenderer = syntaxRenderer;
     SignatureResolver = signatureResolver;
 }