Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 void CompareMembers(ComparisonNode parent,
                     ICompMemberContainer reference_container, ICompMemberContainer target_container)
 {
     CompareMemberLists(parent,
                        reference_container.GetInterfaces(), target_container.GetInterfaces());
     CompareMemberLists(parent,
                        reference_container.GetConstructors(), target_container.GetConstructors());
     CompareMemberLists(parent,
                        reference_container.GetMethods(), target_container.GetMethods());
     CompareMemberLists(parent,
                        reference_container.GetProperties(), target_container.GetProperties());
     CompareMemberLists(parent,
                        reference_container.GetFields(), target_container.GetFields());
     CompareMemberLists(parent,
                        reference_container.GetEvents(), target_container.GetEvents());
 }
Ejemplo n.º 3
0
		void CompareMembers (ComparisonNode parent,
		                     ICompMemberContainer reference_container, ICompMemberContainer target_container)
		{
			CompareMemberLists (parent,
			                    reference_container.GetInterfaces(), target_container.GetInterfaces());
			CompareMemberLists (parent,
			                    reference_container.GetConstructors(), target_container.GetConstructors());
			CompareMemberLists (parent,
			                    reference_container.GetMethods(), target_container.GetMethods());
			CompareMemberLists (parent,
			                    reference_container.GetProperties(), target_container.GetProperties());
			CompareMemberLists (parent,
			                    reference_container.GetFields(), target_container.GetFields());
			CompareMemberLists (parent,
			                    reference_container.GetEvents(), target_container.GetEvents());
		}
Ejemplo n.º 4
0
        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);
                }
            }
        }