public bool MatchScopes(IResolutionScope scope1, IResolutionScope scope2)
{
if (scope1 == null && scope2 == null)
return true;
if (scope1 == null || scope2 == null)
return false;
var module = scope1 as ModuleDefinition;
if (module != null)
return MatchModules(module, scope2 as ModuleDefinition);
var moduleRef = scope1 as ModuleReference;
if (moduleRef != null)
return MatchModules(moduleRef, scope2 as ModuleReference);
var assemblyRef = scope1 as AssemblyReference;
if (assemblyRef != null)
return MatchAssemblies(assemblyRef, scope2 as AssemblyReference);
var typeRef = scope1 as TypeReference;
if (typeRef != null)
return MatchTypes(typeRef, scope2 as TypeReference);
return false;
}