Exemplo n.º 1
0
        private void AddSubNodes(TreeNodeCollection parentNodeCollection, uint superClassClid)
        {
            int directSubclassCount;

            m_mdc.GetDirectSubclasses(superClassClid, 0, out directSubclassCount, null);
            uint[] uIds;
            using (ArrayPtr clids = MarshalEx.ArrayToNative(directSubclassCount, typeof(uint)))
            {
                m_mdc.GetDirectSubclasses(superClassClid, directSubclassCount, out directSubclassCount, clids);
                uIds = (uint[])MarshalEx.NativeToArray(clids, directSubclassCount, typeof(uint));
            }
            SortedList <string, uint> list = new SortedList <string, uint>(uIds.Length);

            foreach (uint subclassClid in uIds)
            {
                string classname = m_mdc.GetClassName(subclassClid);
                list.Add(classname, subclassClid);
            }
            foreach (KeyValuePair <string, uint> kvp in list)
            {
                AddNode(parentNodeCollection, kvp.Key, kvp.Value);
            }
        }