public ZEnumElementInfo(FieldInfo zfieldInfo, FieldInfo sfieldInfo, ZEnumType zenum) { MarkField = zfieldInfo; SharpField = sfieldInfo; ZEnum = zenum; Init(); }
//public static IZDescType CreateZDescType(Type type) //{ // if (ztypeCache.ContainsKey(type)) // { // return ztypeCache[type]; // } // else // { // IZDescType ztype = CreateZTypeImp(type); // if (ztype != null) // { // if (!sharpCache.ContainsKey(ztype.SharpType)) // sharpCache.Add(ztype.SharpType, ztype); // if (!ztypeCache.ContainsKey(type)) // ztypeCache.Add(type, ztype); // } // return ztype; // } //} private static IZDescType CreateZTypeImp(Type type) { if (AttributeUtil.HasAttribute <ZDimAttribute>(type)) { ZDimType zdim = new ZDimType(type); return(zdim); } else if (AttributeUtil.HasAttribute <ZEnumAttribute>(type)) { ZEnumType zenum = new ZEnumType(type); return(zenum); } else if (AttributeUtil.HasAttribute <ZStaticAttribute>(type)) { ZStaticAttribute zAttr = AttributeUtil.GetAttribute <ZStaticAttribute>(type); Type sharpType = (zAttr.SharpType == null ? type : zAttr.SharpType); ZClassType zclass = new ZClassType(type, sharpType, true); return(zclass); } else if (AttributeUtil.HasAttribute <ZInstanceAttribute>(type)) { ZInstanceAttribute zAttr = AttributeUtil.GetAttribute <ZInstanceAttribute>(type); Type sharpType = (zAttr.SharpType == null ? type : zAttr.SharpType); ZClassType zclass = new ZClassType(type, sharpType, false); return(zclass); } return(null); }
public void AddZDescType(IZDescType descType) { if (descType is ZDimType) { DimTypes.Add(descType as ZDimType); } else if (descType is ZEnumType) { ZEnumType zenum = descType as ZEnumType; EnumTypes.Add(zenum); //WordDictionary wordDictionary = zenum.WordTable; //WordDictionaryList.Add(wordDictionary); } else if (descType is ZClassType) { ZClassType zclass = descType as ZClassType; ClassTypes.Add(zclass); //WordDictionary wordDictionary = zclass.WordTable; //WordDictionaryList.Add(wordDictionary); } else { throw new ZyyRTException(); } }