Example #1
0
        public ScriptExportMonoDelegate(TypeDefinition @delegate)
        {
            if (@delegate == null)
            {
                throw new ArgumentNullException(nameof(@delegate));
            }
            if (!IsDelegate(@delegate))
            {
                throw new Exception("Type isn't delegate");
            }

            Type = @delegate;

            Name     = ScriptExportMonoType.GetName(Type);
            Module   = ScriptExportMonoType.GetModule(Type);
            FullName = ScriptExportMonoType.GetFullName(Type, Module);
        }
Example #2
0
        public ScriptExportMonoEnum(TypeReference @enum)
        {
            if (@enum == null)
            {
                throw new ArgumentNullException(nameof(@enum));
            }

            Type = @enum;
            if (@enum.Module != null)
            {
                Definition = @enum.Resolve();
            }

            Name     = ScriptExportMonoType.GetName(Type);
            Module   = ScriptExportMonoType.GetModule(Type);
            FullName = ScriptExportMonoType.GetFullName(Type, Module);
        }
Example #3
0
        public ScriptExportMonoGeneric(TypeReference type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (!type.IsGenericInstance)
            {
                throw new Exception("Type isn't generic");
            }

            Type = (GenericInstanceType)type;

            TypeName = ScriptExportMonoType.GetTypeName(Type);
            Name     = ScriptExportMonoType.GetName(Type, TypeName);
            Module   = ScriptExportMonoType.GetModule(Type);
            FullName = ScriptExportMonoType.GetFullName(Type, Module);
        }
        public ScriptExportMonoArray(TypeReference type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (!type.IsArray)
            {
                throw new Exception("Type isn't an array");
            }

            Type = type;

            TypeName = ScriptExportMonoType.GetTypeName(Type);
            Name     = ScriptExportMonoType.GetName(Type, TypeName);
            Module   = ScriptExportMonoType.GetModule(Type);
            FullName = ScriptExportMonoType.GetFullName(Type, Module);
        }
Example #5
0
 public static string ToFullName(CustomAttribute attribute, string module)
 {
     return(ScriptExportMonoType.GetFullName(attribute.AttributeType, module));
 }