コード例 #1
0
        protected override void VisitDocument(DocumentModel documentModel)
        {
            var documentId   = Path.Combine(_username, _repository, documentModel.RelativePath);
            var declarations = documentModel.Tokens.Where(n => n.IsDeclaration && n.IsSearchable);

            var tokenModels = from declaration in declarations
                              select new TokenViewModel(
                _username,
                _repository,
                documentId,
                declaration.FullName,
                declaration.LineNumber
                );

            SearchIndex.AddDeclarationsToIndex(tokenModels);

            base.VisitDocument(documentModel);
        }