예제 #1
0
        public static CallBackObject GetPoolObject(Action <object> callBack, object result)
        {
            CallBackObject callBackObject = null;

            if (PoolObjects.Count != 0)
            {
                callBackObject = PoolObjects.Dequeue();
            }
            else
            {
                callBackObject = new CallBackObject();
            }
            callBackObject.CallBack = callBack;
            callBackObject.Result   = result;
            return(callBackObject);
        }
예제 #2
0
 public static void SetPoolObject(CallBackObject obj)
 {
     obj.CallBack = null;
     obj.Result   = null;
     PoolObjects.Enqueue(obj);
 }