コード例 #1
0
        public ScriptExportDelegate RetrieveDelegate(TypeDefinition @delegate)
        {
            string fullname = ScriptExportMonoType.GetFullName(@delegate);

            if (m_delegates.TryGetValue(fullname, out ScriptExportDelegate exportDelegate))
            {
                return(exportDelegate);
            }
            return(CreateDelegate(@delegate));
        }
コード例 #2
0
        public ScriptExportEnum RetrieveEnum(TypeDefinition @enum)
        {
            string fullname = ScriptExportMonoType.GetFullName(@enum);

            if (m_enums.TryGetValue(fullname, out ScriptExportEnum exportEnum))
            {
                return(exportEnum);
            }
            return(CreateEnum(@enum));
        }
コード例 #3
0
        public ScriptExportGeneric RetrieveGeneric(TypeReference generic)
        {
            string fullname = ScriptExportMonoType.GetFullName(generic);

            if (m_generic.TryGetValue(fullname, out ScriptExportGeneric exportGeneric))
            {
                return(exportGeneric);
            }
            return(CreateGeneric(generic));
        }
コード例 #4
0
        public ScriptExportArray RetrieveArray(TypeReference array)
        {
            string fullname = ScriptExportMonoType.GetFullName(array);

            if (m_arrays.TryGetValue(fullname, out ScriptExportArray exportArray))
            {
                return(exportArray);
            }
            return(CreateArray(array));
        }
        public ScriptExportPointer RetrievePointer(TypeReference pointer)
        {
            string fullname = ScriptExportMonoType.GetFullName(pointer);

            if (m_pointers.TryGetValue(fullname, out ScriptExportPointer exportArray))
            {
                return(exportArray);
            }
            return(CreatePointer(pointer));
        }
        public ScriptExportType RetrieveType(TypeReference type)
        {
            if (type.IsArray)
            {
                return(RetrieveArray(type));
            }
            if (type.IsPointer)
            {
                return(RetrievePointer(type));
            }
            if (type.IsGenericInstance)
            {
                return(RetrieveGeneric(type));
            }
            if (type.IsGenericParameter)
            {
                return(CreateType(type, false));
            }

            if (type.Module != null)
            {
                TypeDefinition definition = type.Resolve();
                if (definition != null)
                {
                    if (definition.IsEnum)
                    {
                        return(RetrieveEnum(definition));
                    }
                    if (ScriptExportMonoDelegate.IsDelegate(definition))
                    {
                        return(RetrieveDelegate(definition));
                    }
                }
            }

            string fullname = ScriptExportMonoType.GetFullName(type);

            if (m_types.TryGetValue(fullname, out ScriptExportType exportType))
            {
                return(exportType);
            }
            return(CreateType(type));
        }