Esempio n. 1
0
        public List <V> LoadFrom <V>(TransReceiveParam receiveParam) where V : AbstractEntity, new()
        {
            List <V> dataList = null;

            if (_container != null && _loadFactory != null)
            {
                if (_container.IsEmpty)
                {
                    Initialize();
                }
                if (_container.LoadingStatus != LoadingStatus.None)
                {
                    //ReLoad时需要清除掉之前的
                    _container.Collection.Clear();
                }
                _container.OnLoadFactory(() =>
                {
                    if (_cachePool.TryReceiveData(receiveParam, out dataList))
                    {
                        return(true);
                    }
                    return(false);
                }, true);
            }
            return(dataList);
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="V"></typeparam>
 /// <param name="receiveParam"></param>
 /// <param name="dataList"></param>
 /// <returns></returns>
 public bool TryReceiveData <V>(TransReceiveParam receiveParam, out List <V> dataList) where V : AbstractEntity, new()
 {
     return(_cachePool.TryReceiveData(receiveParam, out dataList));
 }