Пример #1
0
 private bool ReadSio(Stream s)
 {
     Sio.SDataBuff d = new Sio.SDataBuff();
     if (d.UnSerializ(s))
     {
         Sio.SListReader lr = d.listReader;
         if (lr != null)
         {
             Sio.SDataBuff b = new Sio.SDataBuff();
             while (lr.Next(b))
             {
                 Sio.SMapReader mr = b.mapReader;
                 if (mr != null)
                 {
                     NModule tm = new NModule();
                     if (tm.Unserial(mr))
                     {
                         Add(tm);
                     }
                 }
             }
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
        private void Clear(NModule o)
        {
            IList <NFunction> functionList = o.GetFunctionList();

            for (int i = 0; i < functionList.Count; i++)
            {
                Clear(functionList[i]);
            }
        }
Пример #3
0
 public bool Remove(NModule m)
 {
     for (int index = 0; index < moduelCache.Count; ++index)
     {
         if (moduelCache[index].Equals(m))
         {
             Clear(m);
             moduelCache.RemoveAt(index);
             return(true);
         }
     }
     return(false);
 }
Пример #4
0
 private bool ReadBinary(Stream s)
 {
     if (s != null)
     {
         uint size = Core.Unity.Convert.ReadUint(s);
         for (uint index = 0; index < size; ++index)
         {
             NModule m = new NModule();
             if (m.Unserial(s))
             {
                 Add(m);
             }
         }
         return(true);
     }
     return(false);
 }
Пример #5
0
 public bool Add(NModule m)
 {
     if (m != null)
     {
         Remove(m);
         moduelCache.Add(m);
         IList <NFunction> functionList = m.GetFunctionList();
         for (int i = 0; i < functionList.Count; i++)
         {
             NFunction f = functionList[i];
             if (functionCache.ContainsKey(f.Id))
             {
                 functionCache[f.Id] = f;
             }
             else
             {
                 functionCache.Add(f.Id, f);
             }
         }
         return(true);
     }
     return(false);
 }