Пример #1
0
        void initByAttr(CnEnDict wordDict)
        {
            var tattr = Attribute.GetCustomAttribute(MType, typeof(ZMappingAttribute));

            if (tattr != null)
            {
                attr    = tattr as ZMappingAttribute;
                ForType = attr.ForType;
                if (MType != typeof(事物))
                {
                    if (attr.BaseMappingType != null)
                    {
                        ParentMapping = new MappingGcl(attr.BaseMappingType, wordDict);
                    }
                    else
                    {
                        ParentMapping = new MappingGcl(typeof(事物), wordDict);
                    }
                }
            }
            else
            {
                throw new CompileException("没有找到MappingTypeAttribute");
            }
        }
Пример #2
0
        public IGcl CreateNewFor(Type forType)
        {
            MappingGcl gcl = new MappingGcl(MType, this.WordDict);

            //gcl.MType = this.MType;
            gcl.ForType = forType;
            //gcl.WordDict = this.WordDict;
            return(gcl);
        }