Exemplo n.º 1
0
        public override void VisitSee(SeeComment comment, CommentRendererContext context)
        {
            var identity = comment.Member;
            var member   = context.ApiContext.Resolver.FindType(comment.Member);

            if (member != null)
            {
                var signature = member.Definition.GetTypeSignature(context.ApiContext.UrlResolver);
                const TypeRenderOption options = TypeRenderOption.Link | TypeRenderOption.Name;
                var result = context.ApiContext.SignatureRenderer.Render(context.ApiContext.Language, signature, options);
                context.Builder.AppendRaw(result);
            }
            else
            {
                // TODO: We need to find the link to external types. Save this for later.
                context.Builder.AppendRaw("<i>");
                var name = context.ApiContext.Language.GetAlias(identity);
                if (name == null)
                {
                    var index = identity.IndexOf(':');
                    context.Builder.AppendEncoded(index != 0 ? identity.Substring(index + 1) : "???");
                }
                else
                {
                    context.Builder.AppendEncoded("????");
                }
                context.Builder.AppendRaw("</i>");
            }
        }
Exemplo n.º 2
0
        public override void VisitSee(SeeComment comment, CommentRendererContext context)
        {
            var docs = context.Services.Model.FindType(comment.Member);

            if (docs != null)
            {
                var signature = context.Services.SignatureResolver.GetTypeSignature(docs);
                context.Services.SignatureRenderer.Render(context.Writer, signature, TypeRenderOption.Name | TypeRenderOption.Link);
            }
            else
            {
                // Scrub the CRef name.
                var name       = comment.Member;
                var colonIndex = name.IndexOf(':');
                if (colonIndex != -1)
                {
                    name = name.Substring(colonIndex + 1);
                }
                var lastApostrophe = name.LastIndexOf('`');
                if (lastApostrophe != -1)
                {
                    name = name.Substring(0, lastApostrophe);
                }

                context.Writer.RenderBeginTag(HtmlTextWriterTag.I);
                context.Writer.Write(name);
                context.Writer.RenderEndTag();
            }
        }
Exemplo n.º 3
0
 public override void VisitSee(SeeComment comment, StringBuilder context)
 {
     context.AppendFormat("<see cref=\"{0}\" />", comment.Member);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Visits a <c>see</c> comment.
 /// </summary>
 /// <param name="comment">The comment.</param>
 /// <param name="context">The context.</param>
 public virtual void VisitSee(SeeComment comment, TContext context)
 {
 }