Esempio n. 1
0
 public void ReleaseToCache()
 {
     for (var i = fields.Count - 1; i >= 0; i--)
     {
         fields[i].ReleaseToCache();
         fields.RemoveAt(i);
     }
     this.Tmpl = null;
     ObjectCache.Put(this);
 }
Esempio n. 2
0
 public static void Push(byte[] tmplData)
 {
     using (var br = ByteReader.Create(tmplData))
     {
         var count = br.ReadShort();
         for (int i = 0; i < count; i++)
         {
             var tmpl = DDNodeTmpl.Decode(br);
             nodeTmpls.Add(tmpl.fullName, tmpl);
         }
     }
 }
Esempio n. 3
0
        public void InitTmpl(string tmplName)
        {
            this.Tmpl = DDTmpl.GetTmpl(tmplName);
            this.fields.Clear();
            var fts = Tmpl.fieldTmpls;

            for (int i = 0; i < fts.Length; i++)
            {
                var field = ObjectCache.Get <DDField>();
                field.InitTmpl(fts[i]);
                fields.Add(field);
            }
        }