Exemple #1
0
        void UpdateMemberNodes(TypeTreeNode typeNode)
        {
            // If it's not been loaded, we've got nothing to do
            if (typeNode.LazyLoading)
            {
                return;
            }

            var existing = new HashSet <object>();

            foreach (var child in typeNode.Children)
            {
                var memberNode = child as IMemberTreeNode;
                if (memberNode != null)
                {
                    existing.Add(memberNode.Member);
                }
            }

            foreach (var fd in typeNode.TypeDef.Fields)
            {
                if (existing.Contains(fd))
                {
                    continue;
                }
                typeNode.AddToChildren(new FieldTreeNode(fd));
            }

            foreach (var pd in typeNode.TypeDef.Properties)
            {
                if (existing.Contains(pd))
                {
                    continue;
                }
                typeNode.AddToChildren(new PropertyTreeNode(pd, typeNode));
            }

            foreach (var ed in typeNode.TypeDef.Events)
            {
                if (existing.Contains(ed))
                {
                    continue;
                }
                typeNode.AddToChildren(new EventTreeNode(ed));
            }

            var accessorMethods = typeNode.TypeDef.GetAccessorMethods();

            foreach (var md in typeNode.TypeDef.Methods)
            {
                if (existing.Contains(md))
                {
                    continue;
                }
                if (!accessorMethods.Contains(md))
                {
                    typeNode.AddToChildren(new MethodTreeNode(md));
                }
            }
        }
Exemple #2
0
 public void Execute()
 {
     ownerType.EnsureChildrenFiltered();
     ownerType.TypeDef.NestedTypes.Add(nestedType.TypeDef);
     ownerType.AddToChildren(nestedType);
     nestedType.OnReadded();
 }
Exemple #3
0
 public void Execute()
 {
     ownerNode.EnsureChildrenFiltered();
     ownerNode.TypeDef.Events.Add(eventNode.EventDef);
     ownerNode.AddToChildren(eventNode);
 }
Exemple #4
0
 public void Execute()
 {
     ownerNode.EnsureChildrenFiltered();
     ownerNode.TypeDefinition.Properties.Add(propNode.PropertyDefinition);
     ownerNode.AddToChildren(propNode);
 }
Exemple #5
0
 public void Execute()
 {
     ownerNode.EnsureChildrenFiltered();
     ownerNode.TypeDefinition.Fields.Add(fieldNode.FieldDefinition);
     ownerNode.AddToChildren(fieldNode);
 }
Exemple #6
0
 public void Execute()
 {
     ownerNode.EnsureChildrenFiltered();
     ownerNode.TypeDef.Methods.Add(methodNode.MethodDef);
     ownerNode.AddToChildren(methodNode);
 }