示例#1
0
        public IGcl CreateNewFor(Type forType)
        {
            ExternalGcl gcl = new ExternalGcl();

            gcl.MType = forType;
            //gcl.ForType = forType;
            gcl.WordDict = this.WordDict;
            return(gcl);
        }
示例#2
0
        public static IGcl Load(Type type, CnEnDict wordDict)
        {
            ZMappingAttribute mattr = Attribute.GetCustomAttribute(type, typeof(ZMappingAttribute)) as ZMappingAttribute;

            if (mattr != null)
            {
                return(new MappingGcl(type, wordDict));
            }

            ZClassAttribute tcAttr = Attribute.GetCustomAttribute(type, typeof(ZClassAttribute)) as ZClassAttribute;

            if (tcAttr != null)
            {
                return(new TktGcl(type, wordDict));
            }

            ExternalGcl egcl = new ExternalGcl(type, wordDict);

            return(egcl);
        }