Ejemplo n.º 1
0
        /// <summary>
        /// Set up all the handlers for this CacheEntry
        /// </summary>
        /// <param name="objectType"></param>
        /// <param name="context"></param>
        /// <param name="proxyCallback">callback that should be invoked when update is finished</param>
        public CacheEntry(LoadContext context, Type objectType, Action <CacheEntry> proxyCallback)
        {
            _proxyComplitionCallback = proxyCallback;
            LoadContext = context;
            ObjectType  = objectType;

            _stats = new EntryStats(this);

            // set up our value loaders.
            //
            _cacheLoader                 = new CacheValueLoader(this);
            _cacheLoader.Loading        += ValueLoader_Loading;
            _cacheLoader.ValueAvailable += Cached_ValueAvailable;
            _cacheLoader.LoadFailed     += CacheLoader_Failed;

            _liveLoader                 = new LiveValueLoader(this);
            _liveLoader.Loading        += ValueLoader_Loading;
            _liveLoader.ValueAvailable += Live_ValueAvailable;
            _liveLoader.LoadFailed     += LiveValueLoader_Failed;

            NextCompletedAction = new UpdateCompletionHandler(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Set up all the handlers for this CacheEntry
        /// </summary>
        /// <param name="objectType"></param>
        /// <param name="context"></param>
        /// <param name="proxyCallback">callback that should be invoked when update is finished</param>
        public CacheEntry(LoadContext context, Type objectType, Action<CacheEntry> proxyCallback)
        {
            _proxyComplitionCallback = proxyCallback;
            LoadContext = context;
            ObjectType = objectType;

            _stats = new EntryStats(this);

            // set up our value loaders.
            //
            _cacheLoader = new CacheValueLoader(this);
            _cacheLoader.Loading += ValueLoader_Loading;
            _cacheLoader.ValueAvailable += Cached_ValueAvailable;
            _cacheLoader.LoadFailed += CacheLoader_Failed;

            _liveLoader = new LiveValueLoader(this);
            _liveLoader.Loading += ValueLoader_Loading;
            _liveLoader.ValueAvailable += Live_ValueAvailable;
            _liveLoader.LoadFailed += LiveValueLoader_Failed;

            NextCompletedAction = new UpdateCompletionHandler(this);
        }