Exemplo n.º 1
0
 private static void Strip(MethodDeclarationCollection methods)
 {
     for (int i = methods.Count - 1; i >= 0; i--)
     {
         var method = (BuildMethod)methods[i];
         if (method.Strip)
         {
             methods.RemoveAt(i);
         }
     }
 }
        private void RenameMethods(MethodDeclarationCollection methods)
        {
            if (methods.Count == 0)
            {
                return;
            }

            var renameMethods = new List <MethodDeclaration>(methods.Count);

            // Collect
            foreach (BuildMethod method in methods)
            {
                if (!method.NameChanged && MemberRenameHelper.CanRename(method))
                {
                    renameMethods.Add(method);
                }
            }

            var groups = MemberRenameHelper.GroupMethods(renameMethods);

            int stringIndex = _nameGenerator.StringIndex;

            foreach (var group in groups.Values)
            {
                _nameGenerator.Reset();

                foreach (BuildMethod method in group)
                {
                    method.NewName     = _nameGenerator.GenerateString();
                    method.NameChanged = true;
                    method.Rename      = true;
                }

                if (stringIndex < _nameGenerator.StringIndex)
                {
                    stringIndex = _nameGenerator.StringIndex;
                }
            }

            _nameGenerator.StringIndex = stringIndex;
        }
Exemplo n.º 3
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n, Func<MethodDeclaration, MethodDeclaration, bool> checkitem)
 {
     return Compare<MethodDeclaration>(source,n,checkitem);
 }
Exemplo n.º 4
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n, Func<MethodDeclaration, MethodDeclaration, Action<string, string>, bool> checkitem, Action<string, string> errAct)
 {
     return Compare<MethodDeclaration>(source,n,checkitem,errAct);
 }
Exemplo n.º 5
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n)
 {
     return Compare<MethodDeclaration>(source,n);
 }
Exemplo n.º 6
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n, Func <MethodDeclaration, MethodDeclaration, Action <string, string>, bool> checkitem, Action <string, string> errAct)
 {
     return(Compare <MethodDeclaration>(source, n, checkitem, errAct));
 }
Exemplo n.º 7
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n, Func <MethodDeclaration, MethodDeclaration, bool> checkitem)
 {
     return(Compare <MethodDeclaration>(source, n, checkitem));
 }
Exemplo n.º 8
0
 public static bool Compare(this MethodDeclarationCollection source, MethodDeclarationCollection n)
 {
     return(Compare <MethodDeclaration>(source, n));
 }
        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;
        }