public virtual void VisitMethodDeclarationCollection(IMethodDeclarationCollection value)
 {
     for (int i = 0; i < value.Count; i++)
     {
         VisitMethodDeclaration(value[i]);
     }
 }
Esempio n. 2
0
 public override void VisitMethodDeclarationCollection(IMethodDeclarationCollection value)
 {
     foreach (object obj in value)
     {
         IMethodDeclaration value2 = (IMethodDeclaration)obj;
         VisitMethodDeclaration(value2);
         _formatter.WriteLine();
     }
 }
        public static ICollection GetMethods(ITypeDeclaration value, IVisibilityConfiguration visibility)
        {
            IMethodDeclarationCollection methods = value.Methods;

            if (methods.Count > 0)
            {
                ArrayList list = new ArrayList(0);

                foreach (IMethodDeclaration methodDeclaration in methods)
                {
                    if ((visibility == null) || (IsVisible(methodDeclaration, visibility)))
                    {
                        list.Add(methodDeclaration);
                    }
                }

                foreach (IPropertyDeclaration propertyDeclaration in value.Properties)
                {
                    if (propertyDeclaration.SetMethod != null)
                    {
                        list.Remove(propertyDeclaration.SetMethod.Resolve());
                    }

                    if (propertyDeclaration.GetMethod != null)
                    {
                        list.Remove(propertyDeclaration.GetMethod.Resolve());
                    }
                }

                foreach (IEventDeclaration eventDeclaration in value.Events)
                {
                    if (eventDeclaration.AddMethod != null)
                    {
                        list.Remove(eventDeclaration.AddMethod.Resolve());
                    }

                    if (eventDeclaration.RemoveMethod != null)
                    {
                        list.Remove(eventDeclaration.RemoveMethod.Resolve());
                    }

                    if (eventDeclaration.InvokeMethod != null)
                    {
                        list.Remove(eventDeclaration.InvokeMethod.Resolve());
                    }
                }

                list.Sort();
                return(list);
            }

            return(new IMethodDeclaration[0]);
        }
        public static ICollection GetMethods(ITypeDeclaration value, IVisibilityConfiguration visibility)
        {
            IMethodDeclarationCollection methods = value.Methods;
            ICollection result;

            if (methods.Count > 0)
            {
                ArrayList arrayList = new ArrayList(0);
                foreach (object obj in methods)
                {
                    IMethodDeclaration value2 = (IMethodDeclaration)obj;
                    if (visibility == null || IsVisible(value2, visibility))
                    {
                        arrayList.Add(value2);
                    }
                }
                foreach (object obj2 in value.Properties)
                {
                    IPropertyDeclaration propertyDeclaration = (IPropertyDeclaration)obj2;
                    if (propertyDeclaration.SetMethod != null)
                    {
                        arrayList.Remove(propertyDeclaration.SetMethod.Resolve());
                    }
                    if (propertyDeclaration.GetMethod != null)
                    {
                        arrayList.Remove(propertyDeclaration.GetMethod.Resolve());
                    }
                }
                foreach (object obj3 in value.Events)
                {
                    IEventDeclaration eventDeclaration = (IEventDeclaration)obj3;
                    if (eventDeclaration.AddMethod != null)
                    {
                        arrayList.Remove(eventDeclaration.AddMethod.Resolve());
                    }
                    if (eventDeclaration.RemoveMethod != null)
                    {
                        arrayList.Remove(eventDeclaration.RemoveMethod.Resolve());
                    }
                    if (eventDeclaration.InvokeMethod != null)
                    {
                        arrayList.Remove(eventDeclaration.InvokeMethod.Resolve());
                    }
                }
                arrayList.Sort();
                result = arrayList;
            }
            else
            {
                result = new IMethodDeclaration[0];
            }
            return(result);
        }
Esempio n. 5
0
        public static IMethodDeclaration GetMethod(ITypeDeclaration value, string methodName)
        {
            IMethodDeclarationCollection methods = value.Methods;

            for (int i = 0; i < methods.Count; i++)
            {
                if (methodName == methods[i].Name)
                {
                    return(methods[i]);
                }
            }
            return(null);
        }
Esempio n. 6
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n, Func<IMethodDeclaration, IMethodDeclaration, Action<string, string>, bool> checkitem, Action<string, string> errAct)
 {
     return Compare<IMethodDeclaration>(source,n,checkitem,errAct);
 }
Esempio n. 7
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n, Func<IMethodDeclaration, IMethodDeclaration, bool> checkitem)
 {
     return Compare<IMethodDeclaration>(source,n,checkitem);
 }
Esempio n. 8
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n)
 {
     return Compare<IMethodDeclaration>(source,n);
 }
Esempio n. 9
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n, Func <IMethodDeclaration, IMethodDeclaration, Action <string, string>, bool> checkitem, Action <string, string> errAct)
 {
     return(Compare <IMethodDeclaration>(source, n, checkitem, errAct));
 }
Esempio n. 10
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n, Func <IMethodDeclaration, IMethodDeclaration, bool> checkitem)
 {
     return(Compare <IMethodDeclaration>(source, n, checkitem));
 }
Esempio n. 11
0
 public static bool Compare(this IMethodDeclarationCollection source, IMethodDeclarationCollection n)
 {
     return(Compare <IMethodDeclaration>(source, n));
 }
Esempio n. 12
0
 public virtual void VisitMethodDeclarationCollection(IMethodDeclarationCollection value)
 {
     for (int i = 0; i < value.Count; i++)
     {
         this.VisitMethodDeclaration(value[i]);
     }
 }
        public virtual IMethodDeclarationCollection TransformMethodDeclarationCollection(IMethodDeclarationCollection methods)
        {
            IMethodDeclaration[] array = new IMethodDeclaration[methods.Count];
            for (int i = 0; i < methods.Count; i++)
            {
                array[i] = this.TransformMethodDeclaration(methods[i]);
            }

            IMethodDeclarationCollection target = new MethodDeclarationCollection();
            target.AddRange(array);
            return target;
        }
 private void InsituTransformMethodDeclarationCollection(IMethodDeclarationCollection value)
 {
     for (int i = 0; i < value.Count; i++)
     {
         value[i] = this.TransformMethodDeclaration(value[i]);
     }
 }