Exemple #1
0
        public ZCFieldInfo DefineFieldPublic(string name, ZAClassInfo ztype)
        {
            Type         varSharpType = ZTypeUtil.GetTypeOrBuilder(ztype);
            FieldBuilder field        = ClassBuilder.DefineField(name, varSharpType, FieldAttributes.Public);
            ZCFieldInfo  zf           = new ZCFieldInfo(name, (ZAClassInfo)ztype, field);

            _ZCompilingFields.Add(zf);
            return(zf);
        }
Exemple #2
0
        public ZLClassInfo MakeGenericType(params ZType[] argZTypes)
        {
            var         args         = argZTypes.Select(U => ZTypeUtil.GetTypeOrBuilder(U)).ToArray();
            Type        newtype      = this.SharpType.MakeGenericType(args);
            ZLClassInfo newclassinfo = new ZLClassInfo(newtype, newtype, IsStatic);

            newclassinfo._GenericTypeDict = new Dictionary <string, Type>();
            Type[] typeArguments = this.SharpType.GetGenericArguments();
            for (int i = 0; i < typeArguments.Length; i++)
            {
                newclassinfo._GenericTypeDict.Add(typeArguments[i].Name, args[i]);
            }
            return(newclassinfo);
        }
Exemple #3
0
        protected ZEnumElementInfo[] GetEnumElements(Type defType, Type sharpType)
        {
            List <ZEnumElementInfo> flist = new List <ZEnumElementInfo>();

            FieldInfo[] fields = ZTypeUtil.GetEnumItems(defType);
            foreach (var field in fields)
            {
                if (AttributeUtil.HasAttribute <ZCodeAttribute>(field))
                {
                    FieldInfo        sharpField = this.SharpType.GetField(field.Name);
                    ZEnumElementInfo exField    = new ZEnumElementInfo(field, sharpField, this);
                    flist.Add(exField);
                }
            }
            return(flist.ToArray());
        }
Exemple #4
0
 public Type[] GetParameterTypes()
 {
     return(ZParams.Select(u => ZTypeUtil.GetTypeOrBuilder(u.ZParamType)).ToArray());
 }