예제 #1
0
        protected override void LoadChildren()
        {
            // Make sure the order below matches typeOrder above
            this.Children.Add(new BaseTypesTreeNode(type));
            this.Children.Add(new DerivedTypesTreeNode(parentAssemblyNode.AssemblyList, type));
            foreach (TypeDef nestedType in type.NestedTypes.OrderBy(m => m.Name.String, NestedTypeStringComparer))
            {
                this.Children.Add(new TypeTreeNode(nestedType, parentAssemblyNode));
            }
            foreach (FieldDef field in type.Fields.OrderBy(m => m.Name.String, FieldStringComparer))
            {
                this.Children.Add(new FieldTreeNode(field));
            }

            foreach (PropertyDef property in type.Properties.OrderBy(m => m.Name.String, PropertyStringComparer))
            {
                this.Children.Add(new PropertyTreeNode(property));
            }
            foreach (EventDef ev in type.Events.OrderBy(m => m.Name.String, EventStringComparer))
            {
                this.Children.Add(new EventTreeNode(ev));
            }
            HashSet <MethodDef> accessorMethods = type.GetAccessorMethods();

            foreach (MethodDef method in type.Methods.OrderBy(m => m.Name.String, MethodStringComparer))
            {
                if (!accessorMethods.Contains(method))
                {
                    this.Children.Add(new MethodTreeNode(method));
                }
            }
        }
예제 #2
0
 protected override void LoadChildren()
 {
     foreach (var t in typeOrder)
     {
         if (t == typeof(BaseTypesTreeNode))
         {
             this.Children.Add(new BaseTypesTreeNode(type));
         }
         else if (t == typeof(DerivedTypesTreeNode))
         {
             this.Children.Add(new DerivedTypesTreeNode(parentAssemblyNode.AssemblyList, type));
         }
         else if (t == typeof(TypeTreeNode))
         {
             foreach (TypeDef nestedType in type.GetNestedTypes(true))
             {
                 this.Children.Add(new TypeTreeNode(nestedType, parentAssemblyNode));
             }
         }
         else if (t == typeof(FieldTreeNode))
         {
             foreach (FieldDef field in type.GetFields(true))
             {
                 this.Children.Add(new FieldTreeNode(field));
             }
         }
         else if (t == typeof(PropertyTreeNode))
         {
             foreach (PropertyDef property in type.GetProperties(true))
             {
                 this.Children.Add(new PropertyTreeNode(property));
             }
         }
         else if (t == typeof(EventTreeNode))
         {
             foreach (EventDef ev in type.GetEvents(true))
             {
                 this.Children.Add(new EventTreeNode(ev));
             }
         }
         else if (t == typeof(MethodTreeNode))
         {
             HashSet <MethodDef> accessorMethods = type.GetAccessorMethods();
             foreach (MethodDef method in type.GetMethods(true))
             {
                 if (!accessorMethods.Contains(method))
                 {
                     this.Children.Add(new MethodTreeNode(method));
                 }
             }
         }
     }
 }
예제 #3
0
        protected override void LoadChildren()
        {
            if (type.BaseType != null || type.HasInterfaces)
            {
                this.Children.Add(new BaseTypesTreeNode(type));
            }
            if (!type.IsSealed)
            {
                this.Children.Add(new DerivedTypesTreeNode(parentAssemblyNode.AssemblyList, type));
            }
            foreach (TypeDef nestedType in type.NestedTypes.OrderBy(m => m.Name))
            {
                this.Children.Add(new TypeTreeNode(nestedType, parentAssemblyNode));
            }
            foreach (FieldDef field in type.Fields.OrderBy(m => m.Name))
            {
                this.Children.Add(new FieldTreeNode(field));
            }

            foreach (PropertyDef property in type.Properties.OrderBy(m => m.Name))
            {
                this.Children.Add(new PropertyTreeNode(property));
            }
            foreach (EventDef ev in type.Events.OrderBy(m => m.Name))
            {
                this.Children.Add(new EventTreeNode(ev));
            }
            HashSet <MethodDef> accessorMethods = type.GetAccessorMethods();

            foreach (MethodDef method in type.Methods.OrderBy(m => m.Name))
            {
                if (!accessorMethods.Contains(method))
                {
                    this.Children.Add(new MethodTreeNode(method));
                }
            }
        }