本文整理汇总了C#中Monodoc.Node.CreateNode方法的典型用法代码示例。如果您正苦于以下问题:C# Node.CreateNode方法的具体用法?C# Node.CreateNode怎么用?C# Node.CreateNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monodoc.Node
的用法示例。
在下文中一共展示了Node.CreateNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateMember
//
// Performs an XPath query on the document to extract the nodes for the various members
// we also use some extra text to pluralize the caption
//
void PopulateMember (XmlDocument doc, string typename, Node node, string type, string caption)
{
string select = type;
if (select == "Operator") select = "Method";
XmlNodeList list1 = doc.SelectNodes (String.Format ("/Type/Members/Member[MemberType=\"{0}\"]", select));
ArrayList list = new ArrayList();
int i = 0;
foreach (XmlElement n in list1) {
n.SetAttribute("assembler_index", (i++).ToString());
if (type == "Method" && GetMemberName(n).StartsWith("op_")) continue;
if (type == "Operator" && !GetMemberName(n).StartsWith("op_")) continue;
list.Add(n);
}
int count = list.Count;
if (count == 0)
return;
Node nodes_node;
string key = type.Substring (0, 1);
nodes_node = node.CreateNode (caption, key);
switch (type) {
case "Event":
case "Field":
foreach (XmlElement n in list)
nodes_node.CreateNode (GetMemberName (n), n.GetAttribute("assembler_index"));
break;
case "Constructor":
foreach (XmlElement n in list)
nodes_node.CreateNode (EcmaHelpSource.MakeSignature(n, typename), n.GetAttribute("assembler_index"));
break;
case "Property": // properties with indexers can be overloaded too
case "Method":
case "Operator":
foreach (XmlElement n in list) {
bool multiple = false;
foreach (XmlNode nn in list) {
if (n != nn && GetMemberName(n) == nn.Attributes ["MemberName"].InnerText) {
multiple = true;
break;
}
}
string group, name, sig;
if (type != "Operator") {
name = GetMemberName(n);
sig = EcmaHelpSource.MakeSignature(n, null);
group = name;
} else {
EcmaHelpSource.MakeOperatorSignature(n, out name, out sig);
group = name;
}
if (multiple) {
nodes_node.LookupNode (group, group)
.CreateNode (sig, n.GetAttribute("assembler_index"));
} else {
nodes_node.CreateNode (name, n.GetAttribute("assembler_index"));
}
}
foreach (Node n in nodes_node.Nodes) {
if (!n.IsLeaf)
n.Sort ();
}
break;
default:
throw new InvalidOperationException();
}
nodes_node.Sort ();
}