示例#1
0
        static List<object> GetChildren(MomaNode root, string node_name)
        {
            if (node_name == "source")
            return GetChildrenList (root.ChildNodes, "");

            string [] parts = node_name.Split ('-');
            MomaNode current = root;
            for (int i = 0; i < parts.Length; i++) {
            int idx = Int32.Parse (parts [i]);
            current = current.ChildNodes [idx];
            }
            return GetChildrenList (current.ChildNodes, node_name);
        }
示例#2
0
 static MomaNode GetNodes(DataRowCollection rows)
 {
     MomaNode root = new MomaNode ("");
     Dictionary<string, MomaNode> namespaces = new Dictionary<string, MomaNode> ();
     Dictionary<string, MomaNode> types = new Dictionary<string, MomaNode> ();
     foreach (MomaDataSet.MembersRow row in rows) {
     string ns;
     string type;
     string name;
     SplitMember (row.Name, out ns, out type, out name);
     if (type == "BrowserCapabilitiesFactory")
         continue;
     if (ns == "System.Web.UI.WebControls.WebParts")
         continue;
     if (ns == "System.Management" || ns == "System.Management.Instrumentation")
         continue;
     MomaNode nsnode;
     if (!namespaces.TryGetValue (ns, out nsnode)) {
         nsnode = new MomaNode (ns);
         namespaces [ns] = nsnode;
         root.ChildNodes.Add (nsnode);
     }
     MomaNode typenode;
     if (!types.TryGetValue (ns + type, out typenode)) {
         typenode = new MomaNode (type);
         types [ns + type] = typenode;
         nsnode.ChildNodes.Add (typenode);
     }
     MomaNode new_node = new MomaNode (name);
     new_node.FullName = row.Name;
     new_node.NumberOfUses = row.Count;
     if (row.IsTodo)
         new_node.Status |= NodeStatus.Todo;
     if (row.IsNiex)
         new_node.Status |= NodeStatus.Niex;
     if (row.IsMissing)
         new_node.Status |= NodeStatus.Missing;
     typenode.ChildNodes.Add (new_node);
     }
     root.SortAndCount ();
     return root;
 }
示例#3
0
 static MomaNode GetNodes(DataRowCollection rows)
 {
     MomaNode root = new MomaNode ("");
     Dictionary<string, MomaNode> namespaces = new Dictionary<string, MomaNode> ();
     Dictionary<string, MomaNode> types = new Dictionary<string, MomaNode> ();
     foreach (MomaDataSet.MembersRow row in rows) {
         string ns;
         string type;
         string name;
         SplitMember (row.Name, out ns, out type, out name);
         MomaNode nsnode;
         if (!namespaces.TryGetValue (ns, out nsnode)) {
             nsnode = new MomaNode (ns);
             namespaces [ns] = nsnode;
             root.ChildNodes.Add (nsnode);
         }
         MomaNode typenode;
         if (!types.TryGetValue (ns + type, out typenode)) {
             typenode = new MomaNode (type);
             types [ns + type] = typenode;
             nsnode.ChildNodes.Add (typenode);
         }
         MomaNode new_node = new MomaNode (name);
         new_node.FullName = row.Name;
         new_node.NumberOfUses = row.Count;
         if (row.IsTodo)
             new_node.Status |= NodeStatus.Todo;
         if (row.IsNiex)
             new_node.Status |= NodeStatus.Niex;
         if (row.IsMissing)
             new_node.Status |= NodeStatus.Missing;
         typenode.ChildNodes.Add (new_node);
     }
     root.SortAndCount ();
     return root;
 }
示例#4
0
 static int CompareNode(MomaNode a, MomaNode b)
 {
     return String.CompareOrdinal (a.Text, b.Text);
 }
示例#5
0
 static int CompareNode(MomaNode a, MomaNode b)
 {
     return(String.CompareOrdinal(a.Text, b.Text));
 }