FeedComments() 공개 정적인 메소드

public static FeedComments ( MetadataItem item, ITripleSlashCommentParserContext context ) : void
item MetadataItem
context ITripleSlashCommentParserContext
리턴 void
예제 #1
0
        public override MetadataItem DefaultVisit(ISymbol symbol)
        {
            if (!FilterVisitor.CanVisitApi(symbol))
            {
                return(null);
            }
            var item = new MetadataItem
            {
                Name       = VisitorHelper.GetId(symbol),
                CommentId  = VisitorHelper.GetCommentId(symbol),
                RawComment = symbol.GetDocumentationCommentXml(),
                Language   = Language,
            };

            item.DisplayNames          = new SortedList <SyntaxLanguage, string>();
            item.DisplayNamesWithType  = new SortedList <SyntaxLanguage, string>();
            item.DisplayQualifiedNames = new SortedList <SyntaxLanguage, string>();
            item.Source = VisitorHelper.GetSourceDetail(symbol);
            var assemblyName = symbol.ContainingAssembly?.Name;

            item.AssemblyNameList = string.IsNullOrEmpty(assemblyName) ? null : new List <string> {
                assemblyName
            };
            if (!(symbol is INamespaceSymbol))
            {
                var namespaceName = VisitorHelper.GetId(symbol.ContainingNamespace);
                item.NamespaceName = string.IsNullOrEmpty(namespaceName) ? null : namespaceName;
            }

            VisitorHelper.FeedComments(item, GetTripleSlashCommentParserContext(item, _preserveRawInlineComments));
            if (item.Exceptions != null)
            {
                foreach (var exceptions in item.Exceptions)
                {
                    AddReference(exceptions.Type, exceptions.CommentId);
                }
            }

            if (item.Sees != null)
            {
                foreach (var i in item.Sees.Where(l => l.LinkType == LinkType.CRef))
                {
                    AddReference(i.LinkId, i.CommentId);
                }
            }

            if (item.SeeAlsos != null)
            {
                foreach (var i in item.SeeAlsos.Where(l => l.LinkType == LinkType.CRef))
                {
                    AddReference(i.LinkId, i.CommentId);
                }
            }

            _generator.DefaultVisit(symbol, item, this);
            return(item);
        }