示例#1
0
 public override bool HasMember(string name)
 {
     if (base.HasMember(name))
     {
         return(true);
     }
     return(ScriptExportMonoType.HasMember(Type.ElementType, name));
 }
        public ScriptExportMonoAttribute(CustomAttribute attribute)
        {
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }

            Attribute = attribute;

            Module   = ScriptExportMonoType.GetModuleName(Attribute.AttributeType);
            FullName = ToFullName(Attribute, Module);
        }
        public ScriptExportMonoDelegate(TypeDefinition @delegate)
        {
            if (@delegate == null)
            {
                throw new ArgumentNullException(nameof(@delegate));
            }
            if (!IsDelegate(@delegate))
            {
                throw new Exception("Type isn't delegate");
            }

            Type = @delegate;

            NestedName = ScriptExportMonoType.GetNestedName(Type);
            Module     = ScriptExportMonoType.GetModuleName(Type);
            FullName   = ScriptExportMonoType.GetFullName(Type, Module);
        }
示例#4
0
        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.GetName(Type);
            NestedName = ScriptExportMonoType.GetNestedName(Type, TypeName);
            Module     = ScriptExportMonoType.GetModuleName(Type);
            FullName   = ScriptExportMonoType.GetFullName(Type, Module);
        }
示例#5
0
        public ScriptExportMonoEnum(TypeReference @enum)
        {
            if (@enum == null)
            {
                throw new ArgumentNullException(nameof(@enum));
            }

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

            NestedName      = ScriptExportMonoType.GetNestedName(Type);
            CleanNestedName = ScriptExportMonoType.ToCleanName(NestedName);
            Module          = ScriptExportMonoType.GetModuleName(Type);
            FullName        = ScriptExportMonoType.GetFullName(Type, Module);
        }
        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.GetName(Type);
            NestedName = ScriptExportMonoType.GetNestedName(Type, TypeName);
            Module     = ScriptExportMonoType.GetModuleName(Type);
            FullName   = ScriptExportMonoType.GetFullName(Type, Module);
        }
        public ScriptExportMonoPointer(TypeReference type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (!type.IsPointer)
            {
                throw new Exception("Type isn't a pointer");
            }

            Type = type;

            CleanName  = ScriptExportMonoType.GetSimpleName(Type);
            TypeName   = ScriptExportMonoType.GetTypeName(Type);
            NestedName = ScriptExportMonoType.GetNestedName(Type, TypeName);
            Module     = ScriptExportMonoType.GetModuleName(Type);
            FullName   = ScriptExportMonoType.GetFullName(Type, Module);
        }
 public static string ToFullName(CustomAttribute attribute, string module)
 {
     return(ScriptExportMonoType.GetFullName(attribute.AttributeType, module));
 }