예제 #1
0
        private void ResolveCall(SDNode call)
        {
            if (call is SDTargetNode)
            {
                var targetNode = call as SDTargetNode;
                var calledType = _sdRepository.GetTypeByIdentifier(targetNode.CalledType.Identifier);
                var callerType = _sdRepository.GetTypeByIdentifier(targetNode.CallerType.Identifier);

                if (calledType != null && callerType != null && calledType.Identifier != callerType.Identifier && !calledType.IsProjectStranger && !callerType.IsProjectStranger)
                {
                    if (!calledType.IsProjectStranger && calledType.UsedBy.SingleOrDefault(u => u.Identifier == callerType.Identifier) == null)
                    {
                        calledType.UsedBy.Add(callerType);
                    }

                    if (!calledType.IsProjectStranger && callerType.Uses.SingleOrDefault(u => u.Identifier == calledType.Identifier) == null)
                    {
                        callerType.Uses.Add(calledType);
                    }

                    var calledNamespace = _sdRepository.GetNamespaceByIdentifier(calledType.Namespace.Identifier);
                    var callerNamespace = _sdRepository.GetNamespaceByIdentifier(callerType.Namespace.Identifier);

                    if (calledNamespace != null && callerNamespace != null && calledNamespace.Fullname != callerNamespace.Fullname)
                    {
                        if (calledNamespace.UsedBy.SingleOrDefault(u => u.Fullname == callerNamespace.Fullname) == null)
                        {
                            calledNamespace.UsedBy.Add(callerNamespace);
                        }

                        if (callerNamespace.Uses.SingleOrDefault(u => u.Fullname == calledNamespace.Fullname) == null)
                        {
                            callerNamespace.Uses.Add(calledNamespace);
                        }
                    }
                }
            }
            else if (call is SDBlock)
            {
                foreach (var embeddedCall in ((SDBlock)call).Statements)
                {
                    ResolveCall(embeddedCall);
                }
            }
            else if (call is SDConditionalBlock)
            {
                foreach (var embeddedCall in ((SDConditionalBlock)call).TrueStatements)
                {
                    ResolveCall(embeddedCall);
                }
                foreach (var embeddedCall in ((SDConditionalBlock)call).FalseStatements)
                {
                    ResolveCall(embeddedCall);
                }
            }
        }
예제 #2
0
        public SequenceDiagramElement AddNode(string typeIdentifier)
        {
            var node = new SequenceDiagramNode
            {
                TypeIdentifier = typeIdentifier,
                Text           = _sdRepository.GetTypeByIdentifier(typeIdentifier).Fullname
            };

            Nodes.Add(node);

            return(node);
        }
예제 #3
0
        private void ParseTargetNode(SequenceDiagramComposite composite, SDTargetNode targetNode)
        {
            if (!targetNode.CalledType.IsProjectStranger)
            {
                var caller = _sequenceDiagram.Nodes.SingleOrDefault(o => o.TypeIdentifier == targetNode.CallerType.Identifier);
                caller = caller == null?_sequenceDiagram.Nodes.Single(o => o.ID == _sequenceDiagram.StartNodeID) : caller;

                var called = _sequenceDiagram.Nodes.SingleOrDefault(o => o.TypeIdentifier == targetNode.CalledType.Identifier) ?? _sequenceDiagram.AddNode(targetNode.CalledType.Identifier);

                composite.AddConnection(caller.ID, called.ID, targetNode.CalledMethod.Name, targetNode.CalledMethod.Identifier);

                var sdType       = _sdRepository.GetTypeByIdentifier(targetNode.CalledType.Identifier);
                var targetMethod = sdType.Methods.SingleOrDefault(o => o.Identifier == targetNode.CalledMethod.Identifier);
                if (caller.ID != called.ID && targetMethod.ReturnType != null && targetMethod.ReturnType.Type.Name.ToUpper() != "VOID")
                {
                    composite.AddConnection(called.ID, caller.ID, targetMethod.ReturnType.Type.Name, targetNode.CalledMethod.Identifier, true);
                }
            }
        }
예제 #4
0
        private void ParseTargetExpression(InvocationExpressionSyntax expression)
        {
            var compilation = _file.Project.GetCompilationAsync().Result;
            var symbolInfo  = compilation.GetSemanticModel(_file.GetSyntaxTreeAsync().Result).GetSymbolInfo(expression);

            if (symbolInfo.Symbol != null)
            {
                var member = symbolInfo.Symbol;
                var method = member as IMethodSymbol;

                if (method != null)
                {
                    var callerType   = _type;
                    var callerMethod = _method;

                    SDType calledType = null;
                    var    sdType     = _repository.GetTypeByIdentifier(member.ContainingType.GetIdentifier());
                    if (sdType == null)
                    {
                        var sdNamespace = _repository.GetNamespaceByIdentifier(member.ContainingNamespace.ToDisplayString());
                        sdNamespace = sdNamespace ?? new SDNamespace(member.ContainingNamespace.ToDisplayString())
                        {
                            IsProjectStranger = true
                        };
                        calledType = new SDType(member.ContainingType.GetIdentifier(), member.ContainingType.Name, sdNamespace)
                        {
                            IsProjectStranger = true
                        };
                    }
                    else
                    {
                        calledType = sdType;
                    }

                    SDMethod calledMethod = null;
                    if (calledType.IsProjectStranger)
                    {
                        calledMethod = new SDMethod(method.GetIdentifier(), method.Name);
                    }
                    else
                    {
                        SDMethod sdMethod = sdType.Methods.Concat(sdType.Constructors).SingleOrDefault(m => m.Identifier == method.GetIdentifier());
                        if (sdMethod != null)
                        {
                            calledMethod = sdMethod;
                        }
                    }

                    // Only add method, if it is project stranger, public or private (if not only public members option on)
                    if (calledMethod != null)
                    {
                        var token = new SDTargetNode
                        {
                            CalledType   = calledType,
                            CallerType   = callerType,
                            CalledMethod = calledMethod,
                            CallerMethod = callerMethod
                        };

                        _tokenList.Add(token);
                    }
                }
            }
        }
예제 #5
0
        private void ParseTargetExpression(Expression expression)
        {
            if (_file != null)
            {
                var resolver      = new CSharpAstResolver(_file.Project.Compilation, _file.SyntaxTree, _file.UnresolvedTypeSystemForFile);
                var resolveResult = resolver.Resolve(expression);

                if (resolveResult is CSharpInvocationResolveResult)
                {
                    var member = ((CSharpInvocationResolveResult)resolveResult).Member;
                    var method = member as IMethod;

                    if (method != null)
                    {
                        var callerType   = _type;
                        var callerMethod = _method;

                        SDType calledType = null;
                        var    sdType     = _repository.GetTypeByIdentifier(member.DeclaringType.GetIdentifier());
                        if (sdType == null)
                        {
                            var sdNamespace = _repository.GetNamespaceByIdentifier(member.DeclaringType.Namespace);
                            sdNamespace = sdNamespace == null ? new SDNamespace(member.DeclaringType.Namespace)
                            {
                                IsProjectStranger = true
                            } : sdNamespace;
                            calledType = new SDType(member.DeclaringType.GetIdentifier(), member.DeclaringType.Name, sdNamespace)
                            {
                                IsProjectStranger = true
                            };
                        }
                        else
                        {
                            calledType = sdType;
                        }

                        SDMethod calledMethod = null;
                        if (calledType.IsProjectStranger)
                        {
                            calledMethod = new SDMethod(method.GetIdentifier(), method.Name);
                        }
                        else
                        {
                            SDMethod sdMethod = sdType.Methods.Concat(sdType.Constructors).SingleOrDefault(m => m.Identifier == method.GetIdentifier());
                            if (sdMethod != null)
                            {
                                calledMethod = sdMethod;
                            }
                        }

                        // Only add method, if it is project stranger, public or private (if not only public members option on)
                        if (calledMethod != null)
                        {
                            var token = new SDTargetNode
                            {
                                CalledType   = calledType,
                                CallerType   = callerType,
                                CalledMethod = calledMethod,
                                CallerMethod = callerMethod
                            };

                            _tokenList.Add(token);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n<div id=\"");

            #line 15 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.Guid));

            #line default
            #line hidden
            this.Write("\" class=\"typesite\">\r\n\t<div id=\"header\">\r\n\t\t<h2 class=\"type-title\">");

            #line 17 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.Name));

            #line default
            #line hidden
            this.Write("</h2>\r\n\t\t<span class=\"namespace-title\">");

            #line 18 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.DeclaringType.Type.Namespace.Fullname));

            #line default
            #line hidden
            this.Write("</span>\r\n\t</div>\r\n\t<div id=\"subheader\">\r\n\t\t<a href=\"");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.SDProject.ProjectName.Replace(" ", "")));

            #line default
            #line hidden
            this.Write("-Index.html\">Start</a> > <a href=\"");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.DeclaringType.Type.Namespace.Guid));

            #line default
            #line hidden
            this.Write(".html\">");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.DeclaringType.Type.Fullname));

            #line default
            #line hidden
            this.Write("</a> > <a href=\"");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.DeclaringType.Type.Guid));

            #line default
            #line hidden
            this.Write(".html\">");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.DeclaringType.Type.Name));

            #line default
            #line hidden
            this.Write(" > <a href=\"");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.Guid));

            #line default
            #line hidden
            this.Write(".html\">");

            #line 21 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.Name));

            #line default
            #line hidden
            this.Write("</a>\r\n\t</div>\r\n\r\n\t<div id=\"content\">\r\n\t\t<h3 class=\"box-title\">");

            #line 25 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Syntax));

            #line default
            #line hidden
            this.Write("</h3>\r\n\t\t<div class=\"syntax-box\">\r\n\t\t\t");

            #line 27 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(WebUtility.HtmlEncode(SDMember.Syntax)));

            #line default
            #line hidden
            this.Write("\r\n\t\t</div>\r\n        \r\n\t\t");

            #line 30 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            if (SDMember.Documentations.Count > 0)
            {
            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 32 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                var documentation = SDMember.Documentations.GetElementOrDefault(StepInput.CurrentLanguage);
                if (documentation.Summary.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 34 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Summary));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 36 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(documentation.Summary.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                    this.Write("\r\n\t\t\t\t</div>\r\n\t\t\t");

            #line 38 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 40 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.Remarks.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 41 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Remarks));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 43 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(documentation.Remarks.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                    this.Write("\r\n\t\t\t\t</div>\r\n\t\t\t");

            #line 45 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 47 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.Example.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 48 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Example));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 50 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(documentation.Example.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                    this.Write("\r\n\t\t\t\t</div>\r\n\t\t\t");

            #line 52 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 54 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.Returns.ContainsKey("default"))
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 55 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Returns));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 57 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(documentation.Returns["default"].ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                    this.Write("\r\n\t\t\t\t</div>\r\n\t\t\t");

            #line 59 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 61 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.Exceptions.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 62 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Exceptions));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 64 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    foreach (var exception in documentation.Exceptions)
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\t\t<p>");

            #line 65 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(exception.Key));

            #line default
            #line hidden
                        this.Write("</p>\r\n\t\t\t\t\t\t<div class=\"inline\">\r\n\t\t\t\t\t\t\t");

            #line 67 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(exception.Value.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                        this.Write("\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t");

            #line 69 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t</div>\r\n\t\t\t");

            #line 71 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 73 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.Params.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 74 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Parameters));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 76 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    foreach (var parameter in documentation.Params)
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\t\t<p>");

            #line 77 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Key));

            #line default
            #line hidden
                        this.Write("</p>\r\n\t\t\t\t\t\t<div class=\"inline\">\r\n\t\t\t\t\t\t\t");

            #line 79 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(parameter.Value.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                        this.Write("\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t");

            #line 81 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t</div>\r\n\t\t\t");

            #line 83 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 85 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.TypeParams.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 86 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.TypeParameters));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"doc-box markdown\">\r\n\t\t\t\t\t");

            #line 88 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    foreach (var typeParameter in documentation.TypeParams)
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\t\t<p>");

            #line 89 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(typeParameter.Key));

            #line default
            #line hidden
                        this.Write("</p>\r\n\t\t\t\t\t\t<div class=\"inline\">\r\n\t\t\t\t\t\t\t");

            #line 91 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(new Markdown().Transform(typeParameter.Value.ToMarkdown(StepInput.SDProject.Tokens).Transform(Helper.TransformLinkToken))));

            #line default
            #line hidden
                        this.Write("\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t");

            #line 93 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t</div>\r\n\t\t\t");

            #line 95 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t\t");

            #line 97 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                if (documentation.SeeAlsos.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t<h3 class=\"box-title\">");

            #line 98 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.SeeAlso));

            #line default
            #line hidden
                    this.Write("</h3>\r\n\t\t\t\t<div class=\"list-box\">\r\n\t\t\t\t\t<ul>\r\n\t\t\t\t\t");

            #line 101 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                    foreach (var sdToken in documentation.SeeAlsos)
                    {
                        var seeAlso = (SDSeeToken)sdToken;
                        if (!string.IsNullOrEmpty(seeAlso.DeclaringType))
                        {
                            var identifier = string.Format("{0}.{1}", seeAlso.DeclaringType, seeAlso.Name);
                            var sdMember   = SDRepository.GetMemberByIdentifier(identifier);
                            if (sdMember != null)
                            {
            #line default
            #line hidden
                                this.Write(" <li><a href=\"../type/");

            #line 110 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdMember.DeclaringType.Type.Guid));

            #line default
            #line hidden
                                this.Write(".html#");

            #line 110 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdMember.Guid));

            #line default
            #line hidden
                                this.Write("\">");

            #line 110 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdMember.Name));

            #line default
            #line hidden
                                this.Write("</a></li> ");

            #line 110 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                            }
                        }
                        else
                        {
                            var identifier = string.Format("{0}.{1}", seeAlso.Namespace, seeAlso.Name);
                            var sdType     = SDRepository.GetTypeByIdentifier(identifier);
                            if (sdType != null)
                            {
            #line default
            #line hidden
                                this.Write(" <li><a href=\"../type/");

            #line 119 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write(".html\">");

            #line 119 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Fullname));

            #line default
            #line hidden
                                this.Write("</a></li> ");

            #line 119 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                            }
                        }
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t\t</ul>\r\n\t\t\t\t</div>\r\n\t\t\t");

            #line 125 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\r\n\t\t");

            #line 127 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n\t\t");

            #line 129 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            if (SDMember is SDMethod && !((SDMethod)SDMember).IsSequenceDiagramEmpty())
            {
                ((SDMethod)SDMember).GetSequenceDiagram(SDRepository).ToPng(Path.Combine(StepInput.TmpPath, "diagrams", SDMember.Guid + ".png"));

            #line default
            #line hidden
                this.Write("\r\n\t\t\t<div class=\"diagram-box\">\r\n\t\t\t\t<img class=\"diagram-image\" src=\"diagrams/");

            #line 133 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(SDMember.Guid));

            #line default
            #line hidden
                this.Write(".png\"/>\r\n\t\t\t</div>\r\n\r\n\t\t");

            #line 136 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Sites\MemberTemplate.tt"
            }

            #line default
            #line hidden
            this.Write("\t</div>\r\n</div>\r\n\r\n");
            return(this.GenerationEnvironment.ToString());
        }
예제 #7
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("\n\n");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
            foreach (var nameSpace in SDRepository.GetAllNamespaces())
            {
            #line default
            #line hidden
                this.Write("\n                \n<li> <object type=\"text/sitemap\">\n\t\t<param name=\"Name\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(nameSpace.Fullname));

            #line default
            #line hidden
                this.Write("\">\n\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(nameSpace.Guid));

            #line default
            #line hidden
                this.Write(".html\">\n\t</object>\n\n\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                if (nameSpace.Types.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("\n                    \n\t\t<ul>\n\n\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                    foreach (var type in nameSpace.Types)
                    {
                        var sdType = SDRepository.GetTypeByIdentifier(type.Identifier);

            #line default
            #line hidden
                        this.Write("\n\n\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t<param name=\"Name\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Name));

            #line default
            #line hidden
                        this.Write("\">\n\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                        this.Write(".html\">\n\t\t\t\t</object>\n                    \n\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                        if (sdType.Constructors.Count > 0 || sdType.Fields.Count > 0 || sdType.Properties.Count > 0 || sdType.Methods.Count > 0 || sdType.Events.Count > 0)
                        {
            #line default
            #line hidden
                            this.Write("\n                            \n\t\t\t\t<ul>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            if (sdType.Constructors.Count > 0)
                            {
            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t<param name=\"Name\" value=" +
                                           "\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Constructors));

            #line default
            #line hidden
                                this.Write("\">\n\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write("-Constructors.html\">\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                foreach (var constructor in sdType.Constructors)
                                {
            #line default
            #line hidden
                                    this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t\t\t<param name=\"Name\" " +
                                               "value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(constructor.Name));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                    this.Write(".html#");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(constructor.Guid));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t</object> </li>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                }

            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            }

            #line default
            #line hidden
                            this.Write("\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            if (sdType.Fields.Count > 0)
                            {
            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t<param name=\"Name\" value=" +
                                           "\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Fields));

            #line default
            #line hidden
                                this.Write("\">\n\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write("-Fields.html\">\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                foreach (var field in sdType.Fields)
                                {
            #line default
            #line hidden
                                    this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t\t\t<param name=\"Name\" " +
                                               "value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                    this.Write(".html#");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(field.Guid));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t</object> </li>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                }

            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            }

            #line default
            #line hidden
                            this.Write("\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            if (sdType.Properties.Count > 0)
                            {
            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t<param name=\"Name\" value=" +
                                           "\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Properties));

            #line default
            #line hidden
                                this.Write("\">\n\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write("-Properties.html\">\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                foreach (var property in sdType.Properties)
                                {
            #line default
            #line hidden
                                    this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t\t\t<param name=\"Name\" " +
                                               "value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                    this.Write(".html#");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(property.Guid));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t</object> </li>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                }

            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            }

            #line default
            #line hidden
                            this.Write("\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            if (sdType.Methods.Count > 0)
                            {
            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t<param name=\"Name\" value=" +
                                           "\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Methods));

            #line default
            #line hidden
                                this.Write("\">\n\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write("-Methods.html\">\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                foreach (var method in sdType.Methods)
                                {
            #line default
            #line hidden
                                    this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t\t\t<param name=\"Name\" " +
                                               "value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(method.Name));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                    this.Write(".html#");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(method.Guid));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t</object> </li>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                }

            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            }

            #line default
            #line hidden
                            this.Write("\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            if (sdType.Events.Count > 0)
                            {
            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t<param name=\"Name\" value=" +
                                           "\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(StepInput.DocStrings.Events));

            #line default
            #line hidden
                                this.Write("\">\n\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                this.Write("-Events.html\">\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<ul>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                foreach (var eve in sdType.Events)
                                {
            #line default
            #line hidden
                                    this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<li> <object type=\"text/sitemap\">\n\t\t\t\t\t\t\t\t\t<param name=\"Name\" " +
                                               "value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(eve.Name));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t\t<param name=\"Local\" value=\"");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(sdType.Guid));

            #line default
            #line hidden
                                    this.Write(".html#");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                    this.Write(this.ToStringHelper.ToStringWithCulture(eve.Guid));

            #line default
            #line hidden
                                    this.Write("\">\n\t\t\t\t\t\t\t\t</object> </li>\n\n\t\t\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                                }

            #line default
            #line hidden
                                this.Write("\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\n\t\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                            }

            #line default
            #line hidden
                            this.Write("\n\n\t\t\t\t</ul>\n\n\t\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                        }

            #line default
            #line hidden
                        this.Write("\n\n\t\t\t</li>\n\n\t\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                    }

            #line default
            #line hidden
                    this.Write("\n\n\t\t</ul>\n\n\t");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
                }

            #line default
            #line hidden
                this.Write("\n\n\t</li>\n\n");

            #line 1 "D:\Github\SharpDox.Plugins.Chm\src\Templates\Nav\ApiNavTemplate.tt"
            }

            #line default
            #line hidden
            this.Write("\n\n");
            return(this.GenerationEnvironment.ToString());
        }