예제 #1
0
        public int getInheritedAndNotOverridedAttributes(ClassObject classObj, bool IsAll = false)
        {
            int inheritedAndNotOverridedAttributes = 0;

            if (classObj.Ancestors != null)
            {
                foreach (string ascentor in classObj.Ancestors)
                {
                    foreach (ClassObject classObjForAsc in classObjects)
                    {
                        if (classObjForAsc.Name == ascentor)
                        {
                            inheritedAndNotOverridedAttributes += getInheritedAndNotOverridedAttributes(classObjForAsc, true);
                            break;
                        }
                    }
                }
            }
            if (IsAll)
            {
                inheritedAndNotOverridedAttributes += classObj.PrivateAttribCount;
                inheritedAndNotOverridedAttributes += classObj.PublicAttribCount;
            }
            return(inheritedAndNotOverridedAttributes);
        }
예제 #2
0
        public int getInheritedAndNotOverridedMethods(ClassObject classObj, bool IsAll = false)
        {
            int inheritedAndNotOverridedMethods = 0;

            if (classObj.Ancestors != null)
            {
                foreach (string ascentor in classObj.Ancestors)
                {
                    foreach (ClassObject classObjForAsc in classObjects)
                    {
                        if (classObjForAsc.Name == ascentor)
                        {
                            inheritedAndNotOverridedMethods += getInheritedAndNotOverridedMethods(classObjForAsc, true);
                            break;
                        }
                    }
                }
            }
            if (IsAll)
            {
                foreach (MethodObject methodObj in classObj.Methodos)
                {
                    if (!methodObj.IsOverrided)
                    {
                        inheritedAndNotOverridedMethods++;
                    }
                }
            }
            return(inheritedAndNotOverridedMethods);
        }
예제 #3
0
 public int getDIT(ClassObject classObj, int level = 0)
 {
     if (classObj.Ancestors != null)
     {
         List <int> dits = new List <int>();
         dits.Add(0);
         foreach (string ascentor in classObj.Ancestors)
         {
             foreach (ClassObject classObjForAsc in classObjects)
             {
                 if (classObjForAsc.Name == ascentor)
                 {
                     dits.Add(getDIT(classObjForAsc, level + 1));
                     break;
                 }
             }
         }
         return(dits.Max());
     }
     else
     {
         return(level);
     }
 }