コード例 #1
0
        private RawUsingItem CreateUsingItem([NotNull] ItemType itemType, [NotNull] TypeReference typeReference, [NotNull] string memberName, [CanBeNull, ItemNotNull] string[] markers, [CanBeNull] ItemTail customSections, WorkingGraph readingGraph)
        {
            string namespaceName, className, assemblyName, assemblyVersion, assemblyCulture;

            GetTypeInfo(typeReference, out namespaceName, out className, out assemblyName, out assemblyVersion, out assemblyCulture);
            return(RawUsingItem.New(_rawUsingItemsCache, itemType, namespaceName, className, assemblyName, assemblyVersion, assemblyCulture, memberName, markers, customSections, readingGraph));
        }
コード例 #2
0
        protected override IEnumerable <RawUsingItem> ReadUsingItems(int depth, WorkingGraph readingGraph)
        {
            Log.WriteInfo("Reading " + FullFileName);
            AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(FullFileName);

            try {
                assembly.MainModule.ReadSymbols();
            } catch (Exception ex) {
                Log.WriteWarning(
                    $"Loading symbols for assembly {FullFileName} failed - maybe .PDB file is missing. ({ex.Message})", FullFileName, 0);
            }

            ItemTail customSections = GetCustomSections(readingGraph, assembly.CustomAttributes, null);

            foreach (TypeDefinition type in assembly.MainModule.Types)
            {
                if (type.Name == "<Module>")
                {
                    continue;
                }

                foreach (var usingItem in AnalyzeType(type, customSections, readingGraph))
                {
                    yield return(usingItem);
                }
            }

            AssemblyNameDefinition currentAssembly = assembly.Name;

            yield return(RawUsingItem.New(_rawUsingItemsCache, DOTNETASSEMBLY,
                                          namespaceName: "", className: "", assemblyName: currentAssembly.Name,
                                          assemblyVersion: currentAssembly.Version.ToString(), assemblyCulture: currentAssembly.Culture,
                                          memberName: "", markers: null, tail: null, readingGraph: readingGraph));
        }
コード例 #3
0
 private IEnumerable <RawDependency> CreateTypeAndMethodDependencies(RawUsingItem usingItem,
                                                                     TypeReference usedType, DotNetUsage dotNetUsage, WorkingGraph readingGraph)
 {
     return(CreateTypeAndMethodDependencies(usingItem,
                                            DOTNETTYPE, GetMemberMarkers(Resolve(usedType), _typeDefinitionMarkers), usedType,
                                            usage: dotNetUsage, sequencePoint: null, memberName: "", readingGraph: readingGraph));
 }
コード例 #4
0
        private RawUsingItem GetClassItem(TypeReference typeReference, ItemTail customSections, WorkingGraph readingGraph)
        {
            string namespaceName, className, assemblyName, assemblyVersion, assemblyCulture;

            GetTypeInfo(typeReference, out namespaceName, out className, out assemblyName, out assemblyVersion, out assemblyCulture);

            return(RawUsingItem.New(_rawUsingItemsCache, DotNetAssemblyDependencyReaderFactory.DOTNETTYPE,
                                    namespaceName, className, assemblyName, assemblyVersion, assemblyCulture, memberName: "",
                                    markers: null, tail: customSections, readingGraph: readingGraph));
        }
コード例 #5
0
        private IEnumerable <RawDependency> AnalyzeGetterSetter([NotNull] TypeDefinition owner, [NotNull] PropertyDefinition property,
                                                                [NotNull] string[] markers, [CanBeNull] ItemTail propertyCustomSections,
                                                                [CanBeNull] MethodDefinition getterSetter, WorkingGraph readingGraph)
        {
            if (getterSetter != null)
            {
                RawUsingItem usingItem = CreateUsingItem(DOTNETPROPERTY, property.DeclaringType,
                                                         property.Name, markers, propertyCustomSections, readingGraph);
                // readingGraph: WHY???yield return new RawDependency(DOTNETITEM, usingItem, null, null);

                foreach (var dependency in AnalyzeMethod(owner, usingItem, getterSetter, readingGraph))
                {
                    yield return(dependency);
                }
            }
        }
コード例 #6
0
 public RawDependency([NotNull] RawUsingItem usingItem, [NotNull] RawUsedItem usedItem,
                      DotNetUsage usage, [CanBeNull] SequencePoint sequencePoint, AbstractDotNetAssemblyDependencyReader readerForUsedItem)
 {
     if (usingItem == null)
     {
         throw new ArgumentNullException(nameof(usingItem));
     }
     if (usedItem == null)
     {
         throw new ArgumentNullException(nameof(usedItem));
     }
     UsingItem          = usingItem;
     UsedItem           = usedItem;
     Usage              = usage;
     _readerForUsedItem = readerForUsedItem;
     _sequencePoint     = sequencePoint;
 }
コード例 #7
0
 private IEnumerable <RawDependency> AnalyzeCustomAttributes([NotNull] RawUsingItem usingItem,
                                                             [NotNull] IEnumerable <CustomAttribute> customAttributes, WorkingGraph readingGraph)
 {
     foreach (CustomAttribute customAttribute in customAttributes)
     {
         foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem,
                                                                     DOTNETITEM, null, customAttribute.Constructor.DeclaringType, usage: DotNetUsage._usesmember,
                                                                     sequencePoint: null, memberName: customAttribute.Constructor.Name, readingGraph: readingGraph))
         {
             yield return(dependency_);
         }
         // See comment at Usage._usesmemberoftype on why this is commented out
         //foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, null, customAttribute.Constructor.DeclaringType,
         //         usage: Usage._usesmemberoftype, sequencePoint: null, memberName: "")) {
         //    yield return dependency_;
         //}
     }
 }
コード例 #8
0
        private IEnumerable <RawDependency> AnalyzeGenericParameter(RawUsingItem usingItem, GenericParameter genericParameter,
                                                                    WorkingGraph readingGraph)
        {
            foreach (var dependency in CreateTypeAndMethodDependencies(usingItem, genericParameter,
                                                                       DotNetUsage._usesasgenericargument, readingGraph))
            {
                yield return(dependency);
            }

            foreach (var constraint in genericParameter.Constraints)
            {
                foreach (var dependency in
                         CreateTypeAndMethodDependencies(usingItem, constraint, DotNetUsage._isconstrainedby, readingGraph))
                {
                    yield return(dependency);
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// Create a single dependency to the calledType or (if passed) calledType+method.
        /// Create additional dependencies for each generic parameter type of calledType.
        /// </summary>
        private IEnumerable <RawDependency> CreateTypeAndMethodDependencies([NotNull] RawUsingItem usingItem,
                                                                            [NotNull] ItemType usedItemType, [CanBeNull, ItemNotNull] string[] usedMarkers, [NotNull] TypeReference usedType,
                                                                            DotNetUsage usage, [CanBeNull] SequencePoint sequencePoint, [NotNull] string memberName, WorkingGraph readingGraph)
        {
            if (usedType is TypeSpecification)
            {
                // E.g. the reference type System.int&, which is used for out parameters.
                // or an arraytype?!?
                usedType = ((TypeSpecification)usedType).ElementType;
            }
            if (!(usedType is GenericInstanceType) && !(usedType is GenericParameter))
            {
                // Here, we do not look at generic type parameters; we would have to
                // untangle the usage of an actual (non-type-parameter) type's member
                // to get a useful Dependency for the user.
                // Generic parameters and their constraints are handled above.

                RawUsedItem usedItem = CreateUsedItem(usedItemType, usedType, memberName, usedMarkers, readingGraph);

                yield return(new RawDependency(usingItem, usedItem, usage, sequencePoint,
                                               _readingContext.ReaderGang.OfType <AbstractDotNetAssemblyDependencyReader>().FirstOrDefault(r => r.AssemblyName == usedItem.AssemblyName)));
            }

            var genericInstanceType = usedType as GenericInstanceType;

            if (genericInstanceType != null)
            {
                foreach (TypeReference genericArgument in genericInstanceType.GenericArguments)
                {
                    foreach (var dependency in CreateTypeAndMethodDependencies(usingItem, DOTNETTYPE,
                                                                               GetMemberMarkers(Resolve(genericArgument), _typeDefinitionMarkers), genericArgument,
                                                                               usage: DotNetUsage._usesasgenericargument, sequencePoint: sequencePoint, memberName: genericArgument.Name,
                                                                               readingGraph: readingGraph))
                    {
                        yield return(dependency);
                    }
                }
            }
        }
コード例 #10
0
 private IEnumerable <RawDependency> AnalyzeInstruction([NotNull] TypeDefinition owner, [NotNull] RawUsingItem usingItem,
                                                        [NotNull] Instruction instruction, [CanBeNull] SequencePoint sequencePoint,
                                                        [NotNull] WorkingGraph readingGraph)
 {
     {
         var methodReference = instruction.Operand as MethodReference;
         // Durch die !IsLinked-Bedingung wird der Test MainTests.Exit0Aspects mit den Calls
         // zwischen Nested-Klassen in NDepCheck.TestAssembly.cs - Klasse Class14.Class13EInner2, Methode SpecialMethodOfInnerClass
         // rot: Weil die Calls zwischen der Class14 und der Nested Class wegen IsLinked==true hier einfach ausgefiltert
         // werden ...
         // WIESO SOLL DAS SO SEIN? - bitte um Erklärung! ==> SIehe nun temporäre Änderung an IsLinked - IST DAS OK?
         if (methodReference != null && !IsLinked(methodReference.DeclaringType, owner))
         {
             foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETMETHOD,
                                                                         GetMemberMarkers(Resolve(methodReference.DeclaringType), _typeDefinitionMarkers),
                                                                         methodReference.DeclaringType, usage: DotNetUsage._usesmember, sequencePoint: sequencePoint,
                                                                         memberName: methodReference.Name, readingGraph: readingGraph))
             {
                 yield return(dependency_);
             }
             // See comment at Usage._usesmemberoftype on why this is commented out
             //foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem,
             //            GetMemberMarkers(Resolve(methodReference.ReturnType), _typeDefinitionMarkers),
             //            methodReference.ReturnType, usage: Usage._usesmemberoftype, sequencePoint: sequencePoint, memberName: "")) {
             //    yield return dependency_;
             //}
         }
     }
     {
         var field = instruction.Operand as FieldDefinition;
         if (field != null && !IsLinked(field.DeclaringType, owner))
         {
             foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETFIELD,
                                                                         GetMemberMarkers(field, _fieldDefinitionMarkers), field.FieldType, usage: DotNetUsage._usesmember,
                                                                         sequencePoint: sequencePoint, memberName: field.Name, readingGraph: readingGraph))
             {
                 yield return(dependency_);
             }
             // See comment at Usage._usesmemberoftype on why this is commented out
             //foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, GetMemberMarkers(field, _fieldDefinitionMarkers),
             //            field.DeclaringType, usage: Usage._usesmemberoftype, sequencePoint: sequencePoint, memberName: "")) {
             //    yield return dependency_;
             //}
         }
     }
     {
         var property = instruction.Operand as PropertyDefinition;
         if (property != null && !IsLinked(property.DeclaringType, owner))
         {
             foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETPROPERTY,
                                                                         GetMemberMarkers(property, _propertyDefinitionMarkers), property.PropertyType,
                                                                         usage: DotNetUsage._usesmember, sequencePoint: sequencePoint, memberName: property.Name, readingGraph: readingGraph))
             {
                 yield return(dependency_);
             }
             // See comment at Usage._usesmemberoftype on why this is commented out
             //foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, GetMemberMarkers(property, _propertyDefinitionMarkers),
             //            property.DeclaringType, usage: Usage._usesmemberoftype, sequencePoint: sequencePoint, memberName: "")) {
             //    yield return dependency_;
             //}
         }
     }
     {
         var typeref = instruction.Operand as TypeReference;
         if (typeref != null && !IsLinked(typeref, owner))
         {
             foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETTYPE,
                                                                         GetMemberMarkers(Resolve(typeref), _typeDefinitionMarkers), typeref,
                                                                         usage: DotNetUsage._usestype, sequencePoint: sequencePoint, memberName: "", readingGraph: readingGraph))
             {
                 yield return(dependency_);
             }
         }
     }
 }
コード例 #11
0
        private IEnumerable <RawDependency> AnalyzeMethod([NotNull] TypeDefinition owner, [NotNull] RawUsingItem usingItem,
                                                          [NotNull] MethodDefinition method, WorkingGraph readingGraph)
        {
            foreach (var dependency_ in AnalyzeCustomAttributes(usingItem, method.CustomAttributes, readingGraph))
            {
                yield return(dependency_);
            }

            foreach (ParameterDefinition parameter in method.Parameters)
            {
                foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETPARAMETER,
                                                                            GetParameterMarkers(parameter, _parameterDefinitionMarkers), parameter.ParameterType,
                                                                            usage: DotNetUsage._declaresparameter, sequencePoint: null, memberName: parameter.Name, readingGraph: readingGraph))
                {
                    yield return(dependency_);
                }
            }

            if (method.ReturnType != null && !IsLinked(method.ReturnType, method.DeclaringType.DeclaringType))
            {
                foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETTYPE,
                                                                            GetMemberMarkers(Resolve(method.ReturnType), _typeDefinitionMarkers),
                                                                            method.ReturnType, usage: DotNetUsage._declaresreturntype, sequencePoint: null, memberName: "", readingGraph: readingGraph))
                {
                    yield return(dependency_);
                }
            }

            if (method.HasBody)
            {
                foreach (var variable in method.Body.Variables)
                {
                    if (!IsLinked(variable.VariableType, method.DeclaringType.DeclaringType))
                    {
                        foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETVARIABLE,
                                                                                    GetVariableMarkers(variable, _variableDefinitionMarkers), variable.VariableType,
                                                                                    usage: DotNetUsage._declaresvariable, sequencePoint: null, memberName: variable.Name,
                                                                                    readingGraph: readingGraph))
                        {
                            yield return(dependency_);
                        }
                    }
                }

                SequencePoint mostRecentSeqPoint = null;
                foreach (Instruction instruction in method.Body.Instructions)
                {
                    if (instruction.SequencePoint != null)
                    {
                        mostRecentSeqPoint = instruction.SequencePoint;
                    }
                    foreach (var dependency_ in AnalyzeInstruction(owner, usingItem, instruction, mostRecentSeqPoint, readingGraph))
                    {
                        yield return(dependency_);
                    }
                }
            }
        }
コード例 #12
0
        private IEnumerable <RawDependency> AnalyzeProperty([NotNull] TypeDefinition owner, [NotNull] RawUsingItem usingItem, [NotNull] PropertyDefinition property, [CanBeNull] ItemTail typeCustomSections, WorkingGraph readingGraph)
        {
            ItemTail propertyCustomSections = GetCustomSections(readingGraph, property.CustomAttributes, typeCustomSections);

            foreach (var dependency_ in AnalyzeCustomAttributes(usingItem, property.CustomAttributes, readingGraph))
            {
                yield return(dependency_);
            }

            foreach (ParameterDefinition parameter in property.Parameters)
            {
                foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETPARAMETER,
                                                                            GetParameterMarkers(parameter, _parameterDefinitionMarkers), parameter.ParameterType,
                                                                            usage: DotNetUsage._declaresparameter, sequencePoint: null, memberName: parameter.Name, readingGraph: readingGraph))
                {
                    yield return(dependency_);
                }
            }

            if (property.PropertyType != null)
            {
                foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETTYPE,
                                                                            GetMemberMarkers(property, _propertyDefinitionMarkers), property.PropertyType,
                                                                            usage: DotNetUsage._declaresreturntype, sequencePoint: null, memberName: property.Name,
                                                                            readingGraph: readingGraph))
                {
                    yield return(dependency_);
                }
            }

            foreach (var dependency in AnalyzeGetterSetter(owner, property, GET_MARKER, propertyCustomSections, property.GetMethod, readingGraph))
            {
                yield return(dependency);
            }

            foreach (var dependency in AnalyzeGetterSetter(owner, property, SET_MARKER, propertyCustomSections, property.SetMethod, readingGraph))
            {
                yield return(dependency);
            }
        }
コード例 #13
0
        private IEnumerable <RawDependency> AnalyzeType([NotNull] TypeDefinition type, [CanBeNull] ItemTail parentCustomSections,
                                                        WorkingGraph readingGraph)
        {
            ItemTail typeCustomSections = GetCustomSections(readingGraph, type.CustomAttributes, parentCustomSections);

            {
                RawUsingItem usingItem = CreateUsingItem(DOTNETTYPE,
                                                         type, typeCustomSections, GetMemberMarkers(type, _typeDefinitionMarkers), readingGraph);
                // readingGraph: WHY???yield return new RawDependency(DOTNETITEM, usingItem, null, null);

                foreach (var dependency_ in AnalyzeCustomAttributes(usingItem, type.CustomAttributes, readingGraph))
                {
                    yield return(dependency_);
                }

                if (type.BaseType != null && !IsLinked(type.BaseType, type.DeclaringType))
                {
                    foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETTYPE,
                                                                                GetMemberMarkers(type, _typeDefinitionMarkers), type.BaseType,
                                                                                usage: DotNetUsage._directlyderivedfrom, sequencePoint: null, memberName: "", readingGraph: readingGraph))
                    {
                        yield return(dependency_);
                    }
                }

                foreach (TypeReference interfaceRef in type.Interfaces)
                {
                    foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem,
                                                                                DOTNETTYPE, GetMemberMarkers(Resolve(interfaceRef), _typeDefinitionMarkers), interfaceRef,
                                                                                usage: DotNetUsage._directlyimplements, sequencePoint: null, memberName: "", readingGraph: readingGraph))
                    {
                        yield return(dependency_);
                    }
                }

                foreach (FieldDefinition field in type.Fields)
                {
                    //if (IsLinked(field.FieldType, type.DeclaringType)) {
                    ItemTail fieldCustomSections = GetCustomSections(readingGraph, field.CustomAttributes, typeCustomSections);
                    // readingGraph: WHY??? yield return new RawDependency(DOTNETITEM, GetFullnameItem(type, field.Name, "", fieldCustomSections), null, null);

                    foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETFIELD,
                                                                                GetMemberMarkers(field, _fieldDefinitionMarkers), field.FieldType, usage: DotNetUsage._declaresfield,
                                                                                sequencePoint: null, memberName: field.Name, readingGraph: readingGraph))
                    {
                        yield return(dependency_);
                    }
                    //}
                }

                foreach (EventDefinition @event in type.Events)
                {
                    ItemTail eventCustomSections = GetCustomSections(readingGraph, @event.CustomAttributes, typeCustomSections);
                    // readingGraph: WHY??? yield return new RawDependency(DOTNETITEM, GetFullnameItem(type, @event.Name, "", eventCustomSections), null, null);

                    foreach (var dependency_ in CreateTypeAndMethodDependencies(usingItem, DOTNETEVENT,
                                                                                GetMemberMarkers(@event, _eventDefinitionMarkers), @event.EventType,
                                                                                usage: DotNetUsage._declaresevent, sequencePoint: null, memberName: @event.Name, readingGraph: readingGraph))
                    {
                        yield return(dependency_);
                    }
                }

                foreach (var property in type.Properties)
                {
                    //if (!IsLinked(property.PropertyType, type.DeclaringType)) {
                    foreach (var dependency_ in AnalyzeProperty(type, usingItem, property, typeCustomSections, readingGraph))
                    {
                        yield return(dependency_);
                    }
                    //}
                }
            }

            foreach (MethodDefinition method in type.Methods)
            {
                ItemTail methodCustomSections = GetCustomSections(readingGraph, method.CustomAttributes, typeCustomSections);

                RawUsingItem usingItem = CreateUsingItem(DOTNETMETHOD,
                                                         type, method.Name, GetMemberMarkers(method, _methodDefinitionMarkers), methodCustomSections, readingGraph);
                // readingGraph: WHY???yield return new RawDependency(DOTNETITEM, usingItem, null, null);

                foreach (var dependency_ in AnalyzeMethod(type, usingItem, method, readingGraph))
                {
                    yield return(dependency_);
                }
            }

            foreach (TypeDefinition nestedType in type.NestedTypes)
            {
                foreach (var dependency_ in AnalyzeType(nestedType, typeCustomSections, readingGraph))
                {
                    yield return(dependency_);
                }
            }
        }
コード例 #14
0
        private IEnumerable <RawDependency> AnalyzeType([NotNull] TypeDefinition type, [CanBeNull] ItemTail parentCustomSections,
                                                        WorkingGraph readingGraph)
        {
            ItemTail typeCustomSections = GetCustomSections(readingGraph, type.CustomAttributes, parentCustomSections);

            RawUsingItem usingItem = CreateUsingItem(DOTNETTYPE,
                                                     type, typeCustomSections, GetMemberMarkers(type, _typeDefinitionMarkers), readingGraph);

            // readingGraph: WHY???yield return new RawDependency(DOTNETITEM, usingItem, null, null);

            foreach (var dependency in AnalyzeCustomAttributes(usingItem, type.CustomAttributes, readingGraph))
            {
                yield return(dependency);
            }

            foreach (var genericParameter in type.GenericParameters)
            {
                RawUsedItem usedItem = CreateUsedItem(DOTNETGENERICPARAMETER, genericParameter, genericParameter.Name,
                                                      NO_MARKERS, readingGraph);

                yield return(new RawDependency(usingItem, usedItem, DotNetUsage._usesasgenericargument, sequencePoint: null,
                                               readerForUsedItem: _readingContext.ReaderGang.OfType <AbstractDotNetAssemblyDependencyReader>()
                                               .FirstOrDefault(r => r.AssemblyName == usedItem.AssemblyName)));

                RawUsingItem usingParameter = CreateUsingItem(DOTNETGENERICPARAMETER, genericParameter, genericParameter.Name,
                                                              NO_MARKERS, customSections: null, readingGraph: readingGraph);

                foreach (var rawDependency in AnalyzeGenericParameter(usingParameter, genericParameter, readingGraph))
                {
                    yield return(rawDependency);
                }
            }

            if (type.BaseType != null && !IsLinked(type.BaseType, type.DeclaringType))
            {
                foreach (var dependency in CreateTypeAndMethodDependencies(usingItem,
                                                                           type.BaseType, DotNetUsage._directlyderivedfrom, readingGraph))
                {
                    yield return(dependency);
                }
            }

            foreach (TypeReference interfaceRef in type.Interfaces)
            {
                foreach (var dependency in CreateTypeAndMethodDependencies(usingItem,
                                                                           interfaceRef, DotNetUsage._directlyimplements, readingGraph))
                {
                    yield return(dependency);
                }
            }

            foreach (FieldDefinition field in type.Fields)
            {
                //if (IsLinked(field.FieldType, type.DeclaringType)) {
                ItemTail fieldCustomSections = GetCustomSections(readingGraph, field.CustomAttributes, typeCustomSections);
                // readingGraph: WHY??? yield return new RawDependency(DOTNETITEM, GetFullnameItem(type, field.Name, "", fieldCustomSections), null, null);

                foreach (var dependency in CreateTypeAndMethodDependencies(usingItem, DOTNETFIELD,
                                                                           GetMemberMarkers(field, _fieldDefinitionMarkers), field.FieldType, usage: DotNetUsage._declaresfield,
                                                                           sequencePoint: null, memberName: field.Name, readingGraph: readingGraph))
                {
                    yield return(dependency);
                }
                //}
            }

            foreach (EventDefinition @event in type.Events)
            {
                ItemTail eventCustomSections = GetCustomSections(readingGraph, @event.CustomAttributes, typeCustomSections);
                // readingGraph: WHY??? yield return new RawDependency(DOTNETITEM, GetFullnameItem(type, @event.Name, "", eventCustomSections), null, null);

                foreach (var dependency in CreateTypeAndMethodDependencies(usingItem, DOTNETEVENT,
                                                                           GetMemberMarkers(@event, _eventDefinitionMarkers), @event.EventType,
                                                                           usage: DotNetUsage._declaresevent, sequencePoint: null, memberName: @event.Name, readingGraph: readingGraph))
                {
                    yield return(dependency);
                }
            }

            foreach (var property in type.Properties)
            {
                //if (!IsLinked(property.PropertyType, type.DeclaringType)) {
                foreach (var dependency in AnalyzeProperty(type, usingItem, property, typeCustomSections, readingGraph))
                {
                    yield return(dependency);
                }
                //}
            }


            foreach (MethodDefinition method in type.Methods)
            {
                ItemTail methodCustomSections = GetCustomSections(readingGraph, method.CustomAttributes, typeCustomSections);

                RawUsedItem usedItem = CreateUsedItem(DOTNETMETHOD, type, method.Name,
                                                      GetMemberMarkers(method, _methodDefinitionMarkers), readingGraph);

                yield return
                    (new RawDependency(usingItem, usedItem, DotNetUsage._declaresmethod, sequencePoint: null,
                                       readerForUsedItem: _readingContext.ReaderGang.OfType <AbstractDotNetAssemblyDependencyReader>()
                                       .FirstOrDefault(r => r.AssemblyName == usedItem.AssemblyName)));

                RawUsingItem usingMethod = CreateUsingItem(DOTNETMETHOD, type, method.Name,
                                                           GetMemberMarkers(method, _methodDefinitionMarkers), methodCustomSections, readingGraph);
                // readingGraph: WHY???yield return new RawDependency(DOTNETITEM, usingItem, null, null);

                foreach (var dependency in AnalyzeMethod(type, usingMethod, method, readingGraph))
                {
                    yield return(dependency);
                }
            }

            foreach (TypeDefinition nestedType in type.NestedTypes)
            {
                foreach (var dependency in AnalyzeType(nestedType, typeCustomSections, readingGraph))
                {
                    yield return(dependency);
                }
            }
        }