Example #1
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);
        }
Example #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);
                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);
        }