예제 #1
0
        private List <Triple> BackNonAccessibleConstructor(TypeReference implementingType)
        {
            var contructorTriples = new List <Triple>();

            if (implementingType.Resolve().IsInterface)
            {
                var typesImplementingInterface = _typeService.GetTypesImplementing(implementingType.FullName);
                foreach (var interfaceImplementingType in typesImplementingInterface)
                {
                    var constructors = BackNonAccessibleConstructor(interfaceImplementingType);
                    contructorTriples.AddRange(constructors);
                }
            }
            else
            {
                //var constructors = _triplesHashset.Where(x =>
                //                    x.From.ObjectType != ObjectType.None
                //                    && x.From.ObjectKeyType == implementingType.FullName
                //                    && x.From.ObjectKey.IndexOf(".ctor") > -1).ToList();

                var constructors = _leftConstructorTriplesByTypeKey.Get(implementingType.FullName).Distinct().ToList();

                contructorTriples.AddRange(constructors);
            }

            return(contructorTriples);
        }
예제 #2
0
        public List <Triple> Back(Triple triple)
        {
            if (triple.From.ObjectType == ObjectType.None)
            {
                return(new List <Triple>());
            }

            if (triple.From.OwnerTypeCategory == TypeCategory.Interface)
            {
                var concreteTriples = BackConcrete(triple);
                if (concreteTriples.Any())
                {
                    return(concreteTriples);
                }

                return(BackNonAccessibleConstructor(triple));
            }

            return(_triplesByRight.Get(triple.From.ObjectKey));
        }
예제 #3
0
        private List <Triple> BackConcrete(Triple triple)
        {
            var results                    = new List <Triple>();
            var toMemberMatches            = _triplesByRightObjectKeyMember.Get(triple.From.ObjectKeyMember);
            var typesImplementingInterface = _typeService.GetTypesImplementing(triple.From.ObjectKeyType);

            foreach (var typeImplementing in typesImplementingInterface)
            {
                var tmp = toMemberMatches.Where(x => x.To.ObjectKeyType.Equals(typeImplementing.GetKey())).ToList();
                results.AddRange(tmp);
            }

            return(results);
        }
예제 #4
0
 public List <TypeReference> GetTypesImplementing(string interfaceKey)
 {
     return(_typesByInterfaceImplemented.Get(interfaceKey));
 }
예제 #5
0
        public List <IndexedDelegate> GetAssignedMethods(MethodDefinition parentMethod, MethodReference delegateInvocation)
        {
            string key = GetDelegateKey(parentMethod, delegateInvocation);

            return(_delegateMethods.Get(key));
        }
예제 #6
0
 public List <Triple> Next(Triple triple)
 {
     return(_triplesByLeft.Get(triple.To.ObjectKey));
 }
예제 #7
0
 public List <Triple> GetToViaContructorInstructionKey(string constructorInstructionKey)
 {
     return(_objectInitializerTriplesByRightByConstructorInstructionKey.Get(constructorInstructionKey));
 }
예제 #8
0
 public List <Triple> GetToViaInstructionKey(string instructionKey)
 {
     return(_triplesByRightInstructionKey.Get(instructionKey));
 }
예제 #9
0
 public List <Triple> GetFromViaInstructionKey(string instructionKey)
 {
     return(_triplesByLeftInstructionKey.Get(instructionKey));
 }
예제 #10
0
 public List <Triple> GetToViaInstanceOwnerKey(string instanceOwnerKey)
 {
     return(_triplesByRightInstanceOwnerKey.Get(instanceOwnerKey));
 }