示例#1
0
 /// <summary>
 /// Adds a new request to the stack if it is new.
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="zoom"></param>
 private void NotifyRequest(int x, int y, int zoom)
 {
     lock (_tiles_to_load_stack)
     {
         ThreadParameterObject new_tile_to_load =
             new ThreadParameterObject()
             {
                 x = x,
                 y = y,
                 zoom = zoom
             };
         if (!_tiles_to_load_stack.Contains(new_tile_to_load) && !_current_loading_objects.Contains(new_tile_to_load))
         {
             _tiles_to_load_stack.PushToTop(new_tile_to_load);
             //Console.WriteLine("New request {0}_{1}@{2} STACK {3}",
             //    x, y, zoom, _tiles_to_load_stack.Count);
         }
     }
 }
        /// <summary>
        /// Adds a new request to the stack if it is new.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="zoom"></param>
        private void NotifyRequest(int x, int y)
        {
            lock (_tiles_to_load_stack)
            {
                // if the tile was loaded before don't do it again!
                if (_loaded_tiles.ContainsKey(x) && _loaded_tiles[x].ContainsKey(y))
                {
                    return;
                }

                // notify a new tile if it is not already on the stack.
                ThreadParameterObject new_tile_to_load =
                    new ThreadParameterObject()
                    {
                        x = x,
                        y = y
                    };

                if (!_tiles_to_load_stack.Contains(new_tile_to_load) && !_current_loading_objects.Contains(new_tile_to_load))
                {
                    _tiles_to_load_stack.PushToTop(new_tile_to_load);
                    Console.WriteLine("New request {0}_{1} STACK {2}",
                        x, y, _tiles_to_load_stack.Count);
                }
            }
        }