AsmResolver.Net.SignatureComparer.MatchScopes C# (CSharp) Method

MatchScopes() public method

Determines whether two scope descriptors are considered equal according to their signature.
public MatchScopes ( IResolutionScope scope1, IResolutionScope scope2 ) : bool
scope1 IResolutionScope The first scope to compare.
scope2 IResolutionScope The second scope to compare.
return bool
        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;
        }