void AddExtra(ComparisonNode parent, CompNamed item) { ComparisonNode node = item.GetComparisonNode(); parent.AddChild(node); node.Status = ComparisonStatus.Extra; profile_documentation.AddError(String.Format("Extra contents \"{0}\" in \"{1}\"", item.DisplayName, parent.Name)); if (item is ICompTypeContainer) { ICompTypeContainer c = (ICompTypeContainer)item; foreach (CompNamed ifc in c.GetNestedInterfaces()) { AddExtra(node, ifc); } foreach (CompNamed cls in c.GetNestedClasses()) { AddExtra(node, cls); } foreach (CompNamed cls in c.GetNestedStructs()) { AddExtra(node, cls); } foreach (CompNamed en in c.GetNestedEnums()) { AddExtra(node, en); } } }
int CountComparisons(CompNamed named) { int rv = 1; if (named is ICompMemberContainer) { ICompMemberContainer container = (ICompMemberContainer)named; rv += CountComparisons(container.GetInterfaces()); rv += CountComparisons(container.GetConstructors()); rv += CountComparisons(container.GetMethods()); rv += CountComparisons(container.GetProperties()); rv += CountComparisons(container.GetFields()); } if (named is ICompTypeContainer) { ICompTypeContainer container = (ICompTypeContainer)named; rv += CountComparisons(container.GetNestedInterfaces()); rv += CountComparisons(container.GetNestedClasses()); rv += CountComparisons(container.GetNestedStructs()); rv += CountComparisons(container.GetNestedEnums()); rv += CountComparisons(container.GetNestedDelegates()); } if (named is ICompAttributeContainer) { rv += CountComparisons(((ICompAttributeContainer)named).GetAttributes()); } return(rv); }
void AddExtra(ComparisonNode parent, CompNamed item) { ComparisonNode node = item.GetComparisonNode(); parent.AddChild(node); node.Status = ComparisonStatus.Extra; if (item is ICompTypeContainer) { ICompTypeContainer c = (ICompTypeContainer)item; foreach (CompNamed ifc in c.GetNestedInterfaces()) { AddExtra(node, ifc); } foreach (CompNamed cls in c.GetNestedClasses()) { AddExtra(node, cls); } foreach (CompNamed cls in c.GetNestedStructs()) { AddExtra(node, cls); } foreach (CompNamed en in c.GetNestedEnums()) { AddExtra(node, en); } } }
void CompareNestedTypes(ComparisonNode parent, ICompTypeContainer reference_container, ICompTypeContainer target_container) { CompareTypeLists(parent, reference_container.GetNestedInterfaces(), target_container.GetNestedInterfaces()); CompareTypeLists(parent, reference_container.GetNestedClasses(), target_container.GetNestedClasses()); CompareTypeLists(parent, reference_container.GetNestedStructs(), target_container.GetNestedStructs()); CompareTypeLists(parent, reference_container.GetNestedEnums(), target_container.GetNestedEnums()); CompareTypeLists(parent, reference_container.GetNestedDelegates(), target_container.GetNestedDelegates()); }
void CompareNestedTypes (ComparisonNode parent, ICompTypeContainer reference_container, ICompTypeContainer target_container) { CompareTypeLists (parent, reference_container.GetNestedInterfaces(), target_container.GetNestedInterfaces()); CompareTypeLists (parent, reference_container.GetNestedClasses(), target_container.GetNestedClasses()); CompareTypeLists (parent, reference_container.GetNestedStructs(), target_container.GetNestedStructs()); CompareTypeLists (parent, reference_container.GetNestedEnums(), target_container.GetNestedEnums()); CompareTypeLists (parent, reference_container.GetNestedDelegates(), target_container.GetNestedDelegates()); }
void AddMissing(ComparisonNode parent, CompNamed item) { ComparisonNode node = item.GetComparisonNode(); parent.AddChild(node); node.Status = ComparisonStatus.Missing; comparisons_performed++; if (item is ICompHasBaseType) { string baseTypeName = ((ICompHasBaseType)item).GetBaseType(); if (!string.IsNullOrEmpty(baseTypeName)) { ComparisonNode baseTypeNode = new ComparisonNode(CompType.Class, string.Format("BaseType: {0}", baseTypeName), baseTypeName); baseTypeNode.Status = ComparisonStatus.Missing; node.AddChild(baseTypeNode); } } if (item is ICompTypeContainer) { ICompTypeContainer c = (ICompTypeContainer)item; foreach (CompNamed ifc in c.GetNestedInterfaces()) { AddMissing(node, ifc); } foreach (CompNamed cls in c.GetNestedClasses()) { AddMissing(node, cls); } foreach (CompNamed cls in c.GetNestedStructs()) { AddMissing(node, cls); } foreach (CompNamed en in c.GetNestedEnums()) { AddMissing(node, en); } } if (item is ICompMemberContainer) { ICompMemberContainer c = (ICompMemberContainer)item; foreach (CompNamed ifc in c.GetInterfaces()) { AddMissing(node, ifc); } foreach (CompNamed m in c.GetConstructors()) { AddMissing(node, m); } foreach (CompNamed m in c.GetMethods()) { AddMissing(node, m); } foreach (CompNamed p in c.GetProperties()) { AddMissing(node, p); } foreach (CompNamed f in c.GetFields()) { AddMissing(node, f); } foreach (CompNamed e in c.GetEvents()) { AddMissing(node, e); } } if (item is ICompAttributeContainer) { ICompAttributeContainer c = (ICompAttributeContainer)item; foreach (CompNamed attr in c.GetAttributes()) { AddMissing(node, attr); } } }