Example #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);
        }
Example #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));
        }
Example #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);
        }
Example #4
0
 public List <TypeReference> GetTypesImplementing(string interfaceKey)
 {
     return(_typesByInterfaceImplemented.Get(interfaceKey));
 }
Example #5
0
        public List <IndexedDelegate> GetAssignedMethods(MethodDefinition parentMethod, MethodReference delegateInvocation)
        {
            string key = GetDelegateKey(parentMethod, delegateInvocation);

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