Пример #1
0
 private void AddPropertiesFromBaseType(List <IProperty> l, IReturnType baseType)
 {
     if (baseType != null)
     {
         foreach (IProperty p in baseType.GetProperties())
         {
             bool ok = true;
             if (p.IsOverridable)
             {
                 StringComparer comparer = p.DeclaringType.ProjectContent.Language.NameComparer;
                 foreach (IProperty oldProperty in _c.Properties)
                 {
                     if (comparer.Equals(oldProperty.Name, p.Name))
                     {
                         if (p.IsStatic == oldProperty.IsStatic && object.Equals(p.ReturnType, oldProperty.ReturnType))
                         {
                             if (DiffUtility.Compare(oldProperty.Parameters, p.Parameters) == 0)
                             {
                                 ok = false;
                                 break;
                             }
                         }
                     }
                 }
             }
             if (ok)
             {
                 l.Add(p);
             }
         }
     }
 }
Пример #2
0
        public virtual int CompareTo(IProperty value)
        {
            int cmp;

            if (FullyQualifiedName != null)
            {
                cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName);
                if (cmp != 0)
                {
                    return(cmp);
                }
            }

            return(DiffUtility.Compare(Parameters, value.Parameters));
        }
Пример #3
0
        public virtual int CompareTo(IMethod value)
        {
            int cmp;

            if (FullyQualifiedName != null)
            {
                cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName);
                if (cmp != 0)
                {
                    return(cmp);
                }
            }

            cmp = this.TypeParameters.Count - value.TypeParameters.Count;
            if (cmp != 0)
            {
                return(cmp);
            }

            return(DiffUtility.Compare(Parameters, value.Parameters));
        }
Пример #4
0
        private void AddMethodsFromBaseType(List <IMethod> l, IReturnType baseType)
        {
            if (baseType != null)
            {
                foreach (IMethod m in baseType.GetMethods())
                {
                    if (m.IsConstructor)
                    {
                        continue;
                    }

                    bool ok = true;
                    if (m.IsOverridable)
                    {
                        StringComparer comparer = m.DeclaringType.ProjectContent.Language.NameComparer;
                        foreach (IMethod oldMethod in _c.Methods)
                        {
                            if (comparer.Equals(oldMethod.Name, m.Name))
                            {
                                if (m.IsStatic == oldMethod.IsStatic && object.Equals(m.ReturnType, oldMethod.ReturnType))
                                {
                                    if (DiffUtility.Compare(oldMethod.Parameters, m.Parameters) == 0)
                                    {
                                        ok = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (ok)
                    {
                        l.Add(m);
                    }
                }
            }
        }