AddChild() public method

public AddChild ( ClassItemViewModel item ) : void
item ClassItemViewModel
return void
Esempio n. 1
0
        public void AddNamespaces(List <Interop.AssemblyObject> namespaces)
        {
            foreach (Interop.AssemblyObject n in namespaces)
            {
                ClassItemViewModel nitem = new ClassItemViewModel(
                    new Models.ClassItem()
                {
                    Name      = n.Name,
                    Namespace = n.Namespace,
                    Type      = Models.ClassItemType.Namespace
                },
                    RootItem
                    );

                foreach (Interop.AssemblyObject child in n.Children)
                {
                    ClassItemViewModel citem = new ClassItemViewModel(
                        new Models.ClassItem()
                    {
                        Name      = child.Name,
                        Namespace = child.Namespace,
                        Type      = Models.ClassItemType.Object
                    },
                        nitem
                        );

                    foreach (Interop.AssemblyObject field in child.Fields)
                    {
                        ClassItemViewModel fitem = new ClassItemViewModel(
                            new Models.ClassItem()
                        {
                            Name      = field.Name,
                            Namespace = field.Namespace,
                            Type      = Models.ClassItemType.Field
                        },
                            citem
                            );
                        citem.AddChild(fitem);
                    }

                    foreach (Interop.AssemblyObject property in child.Properties)
                    {
                        ClassItemViewModel pitem = new ClassItemViewModel(
                            new Models.ClassItem()
                        {
                            Name      = property.Name,
                            Namespace = property.Namespace,
                            Type      = Models.ClassItemType.Property
                        },
                            citem
                            );
                        citem.AddChild(pitem);
                    }

                    foreach (Interop.AssemblyObject method in child.Methods)
                    {
                        ClassItemViewModel mitem = new ClassItemViewModel(
                            new Models.ClassItem()
                        {
                            Name      = method.Name,
                            Namespace = method.Namespace,
                            Type      = Models.ClassItemType.Method
                        },
                            citem
                            );
                        citem.AddChild(mitem);
                    }

                    nitem.AddChild(citem);
                }

                RootItem.AddChild(nitem);
            }
        }
Esempio n. 2
0
        public void AddNamespaces(List<Interop.AssemblyObject> namespaces)
        {
            foreach (Interop.AssemblyObject n in namespaces)
            {
                ClassItemViewModel nitem = new ClassItemViewModel(
                    new Models.ClassItem()
                    {
                        Name = n.Name,
                        Namespace = n.Namespace,
                        Type = Models.ClassItemType.Namespace
                    },
                    RootItem
                );

                foreach (Interop.AssemblyObject child in n.Children)
                {
                    ClassItemViewModel citem = new ClassItemViewModel(
                        new Models.ClassItem()
                        {
                            Name = child.Name,
                            Namespace = child.Namespace,
                            Type = Models.ClassItemType.Object
                        },
                        nitem
                    );

                    foreach (Interop.AssemblyObject field in child.Fields)
                    {
                        ClassItemViewModel fitem = new ClassItemViewModel(
                            new Models.ClassItem()
                            {
                                Name = field.Name,
                                Namespace = field.Namespace,
                                Type = Models.ClassItemType.Field
                            },
                            citem
                        );
                        citem.AddChild(fitem);
                    }

                    foreach (Interop.AssemblyObject property in child.Properties)
                    {
                        ClassItemViewModel pitem = new ClassItemViewModel(
                            new Models.ClassItem()
                            {
                                Name = property.Name,
                                Namespace = property.Namespace,
                                Type = Models.ClassItemType.Property
                            },
                            citem
                        );
                        citem.AddChild(pitem);
                    }

                    foreach (Interop.AssemblyObject method in child.Methods)
                    {
                        ClassItemViewModel mitem = new ClassItemViewModel(
                            new Models.ClassItem()
                            {
                                Name = method.Name,
                                Namespace = method.Namespace,
                                Type = Models.ClassItemType.Method
                            },
                            citem
                        );
                        citem.AddChild(mitem);
                    }

                    nitem.AddChild(citem);
                }

                RootItem.AddChild(nitem);
            }
        }