Пример #1
0
 public void ReleaseBK()
 {
     if (_book != null)
     {
         BookKeeperPool.release(ref _book);
     }
 }
Пример #2
0
 public void ReleaseBK()
 {
     if (_returnBK != null)
     {
         BookKeeperPool.release(ref _returnBK);
     }
     foreach (ArgumentInfo ai in _arguments.Values)
     {
         ai.ReleaseBK();
     }
     if (_customBKs != null)
     {
         foreach (SimpleBK bk in _customBKs.Values)
         {
             SimpleBK _bk = bk;
             BookKeeperPool.release(ref _bk);
         }
         _customBKs.Clear();
     }
 }
Пример #3
0
        /// <summary>
        /// Adds a operation to a custom resource. Do not call this method for standard resources
        /// like arg, return, target, selector.
        /// </summary>
        /// <param name="resname"></param>
        /// <param name="op"></param>
        public void AddResourceOp(string resname, string op)
        {
            if (!_bookkeeping)
            {
                return;
            }
            if (_customBKs == null)
            {
                _customBKs = new Dictionary <string, SimpleBK>();
            }
            SimpleBK bk;

            if (!_customBKs.TryGetValue(resname.ToLower(), out bk))
            {
                /*
                 * short ord;
                 * ResourceType rtype = BookKeeper.getResourceType(resname, out ord);
                 * if (rtype != ResourceType.Custom)
                 * {
                 *  if (ord > -1 && rtype == ResourceType.ArgumentEntry)
                 *  {
                 *      AddResourceOp(ord, op);
                 *  }
                 *  else
                 *  {
                 *      AddResourceOp(rtype, op);
                 *  }
                 *  return;
                 * }
                 */

                resname = resname.ToLower();
                bk      = BookKeeperPool.getSimpleBK(ResourceType.Custom, resname);
                _customBKs.Add(resname, bk);
            }
            bk.AddOperation(op);
        }