Ejemplo n.º 1
0
        private IEnumerable <INamedEntity> SearchMethodOld(Entity entity)
        {
            foreach (RenamedBase item in SearchItemOld(entity.Name))
            {
                if (item.EntityType != EntityType.Method)
                {
                    continue;
                }

                RenamedItem i = (RenamedItem)item;
                if (i.CompareParams(entity.MethodParams))
                {
                    yield return(i);
                }
            }
        }
Ejemplo n.º 2
0
        private IEnumerable <INamedEntity> SearchMethodNew(Entity entity, bool allowSubstitution)
        {
            bool hasAdded = false;

            foreach (RenamedBase item in SearchItemNew(entity.Name))
            {
                if (item.EntityType != EntityType.Method)
                {
                    continue;
                }

                RenamedItem i = (RenamedItem)item;
                if (i.CompareParams(entity.MethodParams))
                {
                    hasAdded = true;
                    yield return(i);
                }
            }

            if (hasAdded || !allowSubstitution)
            {
                yield break;
            }

            string[] values = entity.Name.Namespace != null?entity.Name.Namespace.Split('.') : emptyArray;

            List <EntityName> methodParams = new List <EntityName>(entity.MethodParams);

            SubstituteParams(methodParams);

            foreach (RenamedClass renamedClass in classes)
            {
                foreach (RenamedBase item in renamedClass.SearchForNewName(values, 0))
                {
                    yield return(new Entity(entity, item, methodParams));
                }
            }
        }