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)); } } }
public void Execute() { ownerType.EnsureChildrenFiltered(); ownerType.TypeDef.NestedTypes.Add(nestedType.TypeDef); ownerType.AddToChildren(nestedType); nestedType.OnReadded(); }
public void Execute() { ownerNode.EnsureChildrenFiltered(); ownerNode.TypeDef.Events.Add(eventNode.EventDef); ownerNode.AddToChildren(eventNode); }
public void Execute() { ownerNode.EnsureChildrenFiltered(); ownerNode.TypeDefinition.Properties.Add(propNode.PropertyDefinition); ownerNode.AddToChildren(propNode); }
public void Execute() { ownerNode.EnsureChildrenFiltered(); ownerNode.TypeDefinition.Fields.Add(fieldNode.FieldDefinition); ownerNode.AddToChildren(fieldNode); }
public void Execute() { ownerNode.EnsureChildrenFiltered(); ownerNode.TypeDef.Methods.Add(methodNode.MethodDef); ownerNode.AddToChildren(methodNode); }