Exemplo n.º 1
0
 private string doReplace(string openTag, string content, string closeTag)
 {
     if (!Globals.OutSettings.DevOutMode)
     {
         if (CommentsChecker.IsStringEmptyOrComments(content)) return string.Empty;
     }
     //
     OpenTagParser openTagParser = new OpenTagParser("@overloads", openTag);
     string title = openTagParser.TryGetAttribute("title");
     if (string.IsNullOrEmpty(title)) title = "Untitled";
     //
     SignatureParser signatureParser = new SignatureParser(title);
     //
     StringBuilder sb = new StringBuilder();
     //
     sb.AppendLine("");
     sb.AppendLine("<dt>");
     sb.AppendLine("    <h4 id=\"" + signatureParser.CalcId() + "__\" >" + title + "...</h4>"); // "fields()":  <h4 id="fields__" >fields()...</h4>
     sb.AppendLine("</dt>");
     sb.AppendLine("<dd>");
     sb.AppendLine("    <dl>");
     //
     sb.AppendLine(content);
     //
     sb.AppendLine("    </dl>");
     sb.AppendLine("</dd>");
     //
     return sb.ToString();
 }
Exemplo n.º 2
0
 public void TestSignatureParser_CalcId()
 {
     SignatureParser parser = null;
     //
     parser = new SignatureParser("func()");
     Assert.AreEqual("func", parser.CalcId());
     //
     parser = new SignatureParser("Static func()");
     Assert.AreEqual("func", parser.CalcId());
     //
     parser = new SignatureParser("func(a)");
     Assert.AreEqual("func__a", parser.CalcId());
     //
     parser = new SignatureParser("Static func(a,b,c)");
     Assert.AreEqual("func__a_b_c", parser.CalcId());
     //
     parser = new SignatureParser("Static func(a,b,...)");
     Assert.AreEqual("func__a_b_", parser.CalcId());
 }