private void networkServer_ImageLoaded(object sender, TileLoadResultEventArgs e)
        {
            pendingImages.Remove(e.ID);

            bool saveToFileCache = !networkServer.CanLoadFast(e.ID) && saveToCache;

            if (saveToFileCache && e.Result == TileLoadResult.Success)
            {
                BeginSaveImage(e.ID, e.Image);
            }
            if (e.Result == TileLoadResult.Success)
            {
                networkFailures = 0;
                memoryServer.BeginSaveImage(e.ID, e.Image);
            }
            else
            {
                networkFailures++;
                if (autoSwitchToOffline && (networkFailures > maxConsequentNetworkFailuresToSwitchToOffline))
                {
                    Mode = TileSystemMode.CacheOnly;
                }
            }
            ImageLoaded.Raise(this, e);
        }
Exemplo n.º 2
0
        private void sourceServer_ImageLoaded(object sender, TileLoadResultEventArgs e)
        {
            pendingImages.Remove(e.ID);

            if (e.Result == TileLoadResult.Failure)
            {
                errorsCount++;
            }
            else
            {
                errorsCount = 0;
            }

            if (errorsCount > errorsCountToSwitchToOffline && autoSwitchToOffline)
            {
                Mode = TileSystemMode.CacheOnly;
            }

            bool saveToFileCache = !sourceServer.CanLoadFast(e.ID) && saveToCache;

            if (saveToFileCache && e.Result == TileLoadResult.Success)
            {
                BeginSaveImage(e.ID, e.Image, e.Stream);
            }
            if (e.Result == TileLoadResult.Success)
            {
                memoryServer.BeginSaveImage(e.ID, e.Image, e.Stream);
            }
            else
            {
                latestFailuredId = e.ID;
            }
            ImageLoaded.Raise(this, e);
        }
        private void RaiseImageLoaded(TileLoadResultEventArgs args)
        {
            if (ImageLoaded == null)
            {
            }

            ImageLoaded.Raise(this, args);
        }
Exemplo n.º 4
0
        private void fileServer_ImageLoaded(object sender, TileLoadResultEventArgs e)
        {
            pendingImages.Remove(e.ID);

            if (e.Result == TileLoadResult.Success)
            {
                memoryServer.BeginSaveImage(e.ID, e.Image, e.Stream);
            }

            ImageLoaded.Raise(this, e);
        }
Exemplo n.º 5
0
        private void sourceServer_ImageLoaded(object sender, TileLoadResultEventArgs e)
        {
            pendingImages.Remove(e.ID);

            bool saveToFileCache = !sourceServer.CanLoadFast(e.ID) && saveToCache;

            if (saveToFileCache && e.Result == TileLoadResult.Success)
            {
                BeginSaveImage(e.ID, e.Image, e.Stream);
            }
            if (e.Result == TileLoadResult.Success)
            {
                memoryServer.BeginSaveImage(e.ID, e.Image, e.Stream);
            }
            else
            {
                latestFailuredId = e.ID;
            }
            ImageLoaded.Raise(this, e);
        }
Exemplo n.º 6
0
 private void RaiseDataLoaded(TileLoadResultEventArgs args)
 {
     ImageLoaded.Raise(this, args);
 }