Exemplo n.º 1
0
        public int GetHashCode(IResolutionScope obj)
        {
            var module = obj as ModuleDefinition;

            if (module != null)
            {
                return(GetHashCode(module));
            }

            var moduleRef = obj as ModuleReference;

            if (moduleRef != null)
            {
                return(GetHashCode(moduleRef));
            }

            var assemblyRef = obj as AssemblyReference;

            if (assemblyRef != null)
            {
                return(GetHashCode((IAssemblyDescriptor)assemblyRef));
            }

            var typeRef = obj as TypeReference;

            if (typeRef != null)
            {
                return(GetHashCode((ITypeDescriptor)typeRef));
            }

            return(obj.GetHashCode());
        }
Exemplo n.º 2
0
        public int GetHashCode(IResolutionScope obj)
        {
            switch (obj)
            {
            case ModuleDefinition module:
                return(GetHashCode(module));

            case ModuleReference moduleRef:
                return(GetHashCode(moduleRef));

            case AssemblyReference assemblyRef:
                return(GetHashCode((IAssemblyDescriptor)assemblyRef));

            case TypeReference typeRef:
                return(GetHashCode((ITypeDescriptor)typeRef));
            }

            return(obj.GetHashCode());
        }