public override string ToTexCode()
{
List<string> lines = new List<string> ();
string uml = Publicity.ToCode (@"\keyword{", "} ").Replace ("public ", "")
+ Virtuality.ToCode (@"\keyword{", "} ")
+ (IsContructor ? "" : @"\ptype{" + returntype + @"} ")
+ @"\varname{" + name.ToTexCode () + "} (";
for (int i = 0; i < parameters.Length; ++i) {
string[] parts = parameters [i].Split (new char[]{' '}, 2, StringSplitOptions.RemoveEmptyEntries);
if (i > 0)
uml += ", ";
if (parts.Length == 1)
uml += @"\ptype{" + parts [0] + @"}";
else if (parts.Length > 1)
uml += @"\ptype{" + parts [0] + @"} \varname{" + parts [1].ToTexCode () + "}";
}
uml += ")";
// lines.Add (@"\item[" + uml + @"] \item[]");
lines.Add (@"\textbf{" + uml + @"}\newline\newline");
foreach (string _cmt in Comments.GetComments(commentsKey)) {
string cmt = _cmt;
if (cmt.StartsWith ("[") && cmt.EndsWith ("]") && cmt.Contains ("="))
continue;
for (int i = 0; i < parameters.Length; ++i) {
string[] parts = parameters [i].Split (new char[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length > 1) {
cmt = cmt.Replace (parts [1], @"\param{" + parts [1] + @"}");
}
}
cmt = Packages.AddTexCommands (cmt);
lines.Add (cmt);
}
return string.Join ("\n", lines);
}