private IEnumerable<ProjectReference> GetAssemblyTypesReferences(
     AssemblyDefinition assemblyDefinition, AuditEntryParameters parameters)
 {
     var referencedAssemblyTypes = parameters.ProjectMetadata.TypesReferences.
         Select(typeReference => typeReference).
         Join(Helper.GetTypesDefinitions(assemblyDefinition.Modules),
              typeReference => typeReference.FullName.ToLower(),
              moduleTypeDefinition => moduleTypeDefinition.FullName.ToLower(),
              (typeReference, moduleTypeDefinition) => typeReference);
     foreach(var assemblyType in referencedAssemblyTypes)
     {
         if (!parameters.IsTypeChecked(assemblyType))
         {
             TypeDefinition assemblyBaseType = null;
             assemblyBaseType = assemblyType.BaseType != null ?
                 assemblyType.BaseType.Resolve()
                 : null;
             if (assemblyBaseType != null)
             {
                 var pr = parameters.FindProjectReference(assemblyBaseType.Scope);
                 if (pr != null)
                     yield return pr;
                 foreach(var projectReference in
                         m_classTypeHierarchyWorker.Execute(assemblyBaseType, parameters))
                     yield return projectReference;
                 foreach(var projectReference in
                         m_interfacesTypeWorker.Execute(assemblyBaseType, parameters))
                     yield return projectReference;
             }
         }
         foreach(var projectReference in m_memberReferencesWorker.Execute(assemblyType, parameters))
             yield return projectReference;
     }
 }
 public IEnumerable<ProjectReference> Execute(
     TypeDefinition typeDefinition, AuditEntryParameters parameters)
 {
     var importedTypeWorker = new ImportedTypeWorker();
     foreach (var interfaceReference in typeDefinition.GetInterfacesHierarchy())
     {
         var interfaceDefinition = interfaceReference.Resolve();
         if (interfaceDefinition != null)
         {
             ProjectReference projectReference = interfaceDefinition.IsImport ?
                 importedTypeWorker.Execute(interfaceDefinition, parameters)
                 : parameters.FindProjectReference(interfaceDefinition);
             if (projectReference != null)
                 yield return projectReference;
             parameters.AddToCheckedTypes(interfaceDefinition);
         }
     }
 }
 private IEnumerable<ProjectReference> GetCustomAttributeArgumentReferences(
     CustomAttributeArgument customAttributeArgument, AuditEntryParameters parameters)
 {
     TypeDefinition typeDefinition = customAttributeArgument.Value is TypeReference
             ? (customAttributeArgument.Value as TypeReference).Resolve()
             : customAttributeArgument.Type.Resolve();
     if (typeDefinition != null && !parameters.IsTypeChecked(typeDefinition))
     {
         ProjectReference projectReference = parameters.FindProjectReference(typeDefinition.Scope);
         if (projectReference != null)
             yield return projectReference;
         foreach(var pr in
                 m_interfacesTypeWorker.Execute(typeDefinition, parameters))
             yield return pr;
         foreach(var pr in
                 m_classTypeHierarchyWorker.Execute(typeDefinition, parameters))
             yield return pr;
         parameters.AddToCheckedTypes(typeDefinition);
     }
 }
 public IEnumerable<ProjectReference> Execute(
     TypeDefinition typeDefinition, AuditEntryParameters parameters)
 {
     if (typeDefinition == null)
         yield break;
     var baseTypeReference = typeDefinition.BaseType;
     if (baseTypeReference == null || parameters.IsTypeChecked(baseTypeReference))
     {
         parameters.AddToCheckedTypes(typeDefinition);
         yield break;
     }
     var baseTypeDefinition = baseTypeReference.Resolve();
     if (baseTypeDefinition != null)
     {
         var projectReference = parameters.FindProjectReference(baseTypeDefinition);
         if (projectReference != null)
             yield return projectReference;
     }
     foreach(var projectReference in Execute(baseTypeDefinition, parameters))
         yield return projectReference;
     parameters.AddToCheckedTypes(typeDefinition);
 }
 private IEnumerable<ProjectReference> GetTypeReferences(
     TypeReference typeReference, AuditEntryParameters parameters)
 {
     if ((typeReference == null) || (parameters.IsTypeChecked(typeReference)))
         yield break;
     var typeDefinition = typeReference.Resolve();
     if (typeDefinition != null)
     {
         var pr = parameters.FindProjectReference(typeDefinition.Scope);
         if (pr != null)
             yield return pr;
         foreach(var projectReference in
                 m_interfacesTypeWorker.Execute(typeDefinition, parameters))
             yield return projectReference;
         foreach(var projectReference in
                 m_classTypeHierarchyWorker.Execute(typeDefinition, parameters))
             yield return projectReference;
     }
     else
     {
         var pr = parameters.FindProjectReference(typeReference.Scope);
         if (pr != null)
             yield return pr;
     }
     parameters.AddToCheckedTypes(typeReference);
 }
 private ProjectReference GetMarshalInfoReference(
     MarshalInfo marshalInfo, AuditEntryParameters parameters)
 {
     var customMarshalInfo = marshalInfo as CustomMarshalInfo;
     if (customMarshalInfo != null && customMarshalInfo.ManagedType != null)
     {
         var typeDefinition = customMarshalInfo.ManagedType.Resolve();
         if (typeDefinition != null)
         {
             parameters.AddToCheckedTypes(typeDefinition);
             return parameters.FindProjectReference(typeDefinition);
         }
     }
     return null;
 }