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);
 }
 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);
     }
 }
 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;
 }
 private IEnumerable<ProjectReference> GetCustomAttributeReferences(
     CustomAttribute customAttribute, AuditEntryParameters parameters)
 {
     var typeDefinition = customAttribute.AttributeType.Resolve();
     if ((typeDefinition != null) && !parameters.IsTypeChecked(typeDefinition))
     {
         foreach(var projectReference in
                 m_classTypeHierarchyWorker.Execute(typeDefinition, parameters))
             yield return projectReference;
         foreach(var projectReference in m_interfacesTypeWorker.Execute(typeDefinition, parameters))
             yield return projectReference;
         parameters.AddToCheckedTypes(typeDefinition);
     }
     var references = GetCustomAttributeArguments(customAttribute).
         SelectMany(caa => GetCustomAttributeArgumentReferences(caa, parameters));
     foreach(var projectReference in references)
         yield return projectReference;
 }