\n";
res += "
" + (if (ns.Length == 0) "Root namespace" else "Namespace " + ns) +"\n";
def iter = fun (e : Node) {
def ahref = match (e.XMLattrib) { | Unknown => "#" + e.href() | _ => e.html_file() + "#" + e.href() };
mutable r = "";
r += "
";
r += match (e.XMLattrib) { | Type => "class" | Unknown => "namespace" | _ => e.XMLattrib.ToString() };
r += " ";
r += "
" + e.Name + "";
r += if (comment.Length > 0) "" else "";
r += if (remark.Length > 0) "" else "";
r += "
\n";
r
}
// do TOC in the following order: first ordered namespaces, then ordered classes
// def sort = fun (x, y) { String.Compare(x.true_name, y.true_name) };
def cond = fun (n : Node) {
(!publicOnly || (n.attribute == null || !n.attribute.Private)) &&
(n.XMLattrib.Equals(ElementType.Type()) || n.XMLattrib.Equals(ElementType.Unknown()))
}
def class_cond = fun (n : Node) {
n.XMLattrib.Equals(ElementType.Type()) && cond(n)
}
def ns_cond = fun (n : Node) {
n.XMLattrib.Equals(ElementType.Unknown()) && cond(n)
}
// def class_list = List.Sort(List.RevFilter(elements, fun (cl) { cl.XMLattrib.Equals(ElementType.Type() ) }), sort);
def class_part = HtmlGenerator.filteredIter(elements, class_cond, iter);
def ns_part = HtmlGenerator.filteredIter(elements, ns_cond, iter);
res += ns_part + class_part + "
\n";
res
}
/// See also ";
def refTo = this.datatree.seealsoDict[this.seealso];
if (this.datatree.seealsoDict.Contains(this.seealso) && refTo != null)
{
def ahref = (if (this.html_file().Equals(refTo.html_file())) "" else refTo.html_file()) + "#" + refTo.href ();
com += "
" + this.seealso + ""
}
else
{
com += this.seealso;
Console.WriteLine("*** Warning: 'seealso' reference '{0}' cannot be resolved", this.seealso);
}
com += "
\n";
}
mutable att = "";
when (attribute != null)
{
when ( (attribute.attr & TypeAttributes.NotPublic) != 0) att += " notpublic ";
when ( (attribute.attr & TypeAttributes.Sealed) != 0) att += " sealed ";
// when ( attribute.Private) att += " PRIVATE ";
when (attribute.is_abstract) att += " abstract ";
when ( (attribute.attr & TypeAttributes.NestedPublic) != 0) att += " nested public class ";
when (attribute.is_class && att.IndexOf("class") == -1) att += " class ";
when ( (attribute.attr & TypeAttributes.Public) != 0 && att.IndexOf("public") == -1) att += " public ";
when (attribute.is_array) att += " array ";
when (attribute.is_interface) att += " interface ";
// last chance
when (att.Length == 0) att = attribute.attr.ToString();
}
when (this.XMLattrib != null && this.XMLattrib.Equals(ElementType.Type()) && att.IndexOf("class") == -1)
att += " class ";
mutable superclass = "";
when (this.Superclass != null) superclass = " : " + String.Format("" + att;
res += "
" +
this.Name + "" + superclass + "\n";
when (interfaces.Trim().Length > 0)
res += " implements
" + interfaces + "\n";
res += com;
def mk_element = fun (e) { "
" + e.ToHtml() + "
\n"};
def mk_type = fun (e) { "
" + e.ToHtml() + "
\n"};
def methods = HtmlGenerator.filteredIter(elements, fun (e) { e.XMLattrib.Equals(ElementType.Method()) }, mk_element );
when (methods.Length > 0) res += "
Methods:" + methods + "
";
def events = HtmlGenerator.filteredIter(elements, fun (e) { e.XMLattrib.Equals(ElementType.Event()) }, mk_element );
when (events.Length > 0) res += "
Events:" + events + "
";
def props = HtmlGenerator.filteredIter(elements, fun (e) { e.XMLattrib.Equals(ElementType.Property()) }, mk_element);
when (props.Length > 0) res += "
Properties:" + props + "
";
def fields = HtmlGenerator.filteredIter(elements, fun (e) { e.XMLattrib.Equals(ElementType.Field()) }, mk_element);
when (fields.Length > 0) res += "
Fields:" + fields + "
";
def types = HtmlGenerator.filteredIter(elements, fun (e) { e.XMLattrib.Equals(ElementType.Type()) }, mk_type);
when (types.Length > 0) res += "
Types:" + types + "
";
res += "
\n";
}
res
} // method ToHtml
} // class Node
///