/// <summary>
        /// Creates a new instance of the CacheUsageForm
        /// </summary>
        public CacheUsageForm(Tiles tiles, tkCacheType cacheType)
        {
            InitializeComponent();


            this.dgv.CellClick     += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_CellClick);
            this.dgv.CellPainting  += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.dgv_CellPainting);
            this.btnClearAll.Click += new System.EventHandler(this.btnClearAll_Click);

            this.tiles     = tiles;
            this.cacheType = cacheType;

            DataGridViewButtonColumn cmn = (DataGridViewButtonColumn)dgv.Columns[CMN_CLEAR];

            cmn.Text = "Clear";
            cmn.DefaultCellStyle.Padding    = new Padding(2);
            cmn.UseColumnTextForButtonValue = true;

            cmn      = (DataGridViewButtonColumn)dgv.Columns[CMN_SCALES];
            cmn.Text = "Scales";
            cmn.DefaultCellStyle.Padding    = new Padding(2);
            cmn.UseColumnTextForButtonValue = true;

            this.FillGrid();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the control
        /// </summary>
        /// <param name="tiles">The reference to map tiles</param>
        /// <param name="cacheType">The type of cache to deal with</param>
        public void Init(Tiles tiles, tkCacheType cacheType)
        {
            if (tiles == null)
            {
                throw new ArgumentNullException("Tiles reference wasn't passed");
            }

            if (cacheType != tkCacheType.Disk && cacheType != tkCacheType.RAM)
            {
                throw new ArgumentException("Tiles reference wasn't passed");
            }

            this.cacheType      = cacheType;
            this.tiles          = tiles;
            this.groupBox2.Text = cacheType == tkCacheType.Disk ? "Disk cache" : "RAM cache";
            this.lblName.Text   = cacheType == tkCacheType.Disk ? "Disk cache" : "RAM cache";

            string[] sizes = new string[] { "5", "10", "25", "50", "100", "250", "500", "1000" };
            foreach (string s in sizes)
            {
                this.comboBox1.Items.Add(s);
            }

            chkUse.Checked = tiles.get_UseCache(cacheType);
            chkAdd.Checked = tiles.get_DoCaching(cacheType);

            this.UpdateState();
        }
Beispiel #3
0
 /// <summary>
 /// Sets a value indicating whether specific type of cache should be used to display tiles.
 /// </summary>
 /// <param name="cacheType">The type of cache.</param>
 /// <param name="pVal">True if the specific type of cache can be used.</param>
 public void set_UseCache(tkCacheType cacheType, bool pVal)
 {
     throw new NotImplementedException();
 }
Beispiel #4
0
 /// <summary>
 /// Gets a value indicating whether specific type of cache should be used to display tiles.
 /// </summary>
 /// <param name="cacheType">The type of cache.</param>
 /// <returns>True if the specific type of cache can be used.</returns>
 public bool get_UseCache(tkCacheType cacheType)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
 /// <summary>
 /// Sets the maximum allowable size of cache.
 /// </summary>
 /// <param name="cacheType">The type of cache.</param>
 /// <param name="pVal">Maximum size in MB.</param>
 public void set_MaxCacheSize(tkCacheType cacheType, double pVal)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 /// <summary>
 /// Gets the maximum allowable size of cache.
 /// </summary>
 /// <param name="cacheType">The type of cache.</param>
 /// <returns>Maximum size in MB.</returns>
 public double get_MaxCacheSize(tkCacheType cacheType)
 {
     throw new NotImplementedException();
 }
Beispiel #7
0
 /// <summary>
 /// Gets the value indicating whether tiles requested from server will be automatically cached.
 /// </summary>
 /// <param name="cacheType">The type of cache to be used.</param>
 /// <returns>True if automatic caching is on.</returns>
 public bool get_DoCaching(tkCacheType cacheType)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
 /// <summary>
 /// Gets the current size of cache used for specific provider and zoom level.
 /// </summary>
 /// <param name="cacheType">The type of cache to return size for.</param>
 /// <param name="Provider">Provider. ProviderNone will return size for all providers.</param>
 /// <param name="scale">Scale (zoom) level. -1 will return size for all zoom levels.</param>
 /// <returns>The size of cache in MB.</returns>
 public double get_CacheSize2(tkCacheType cacheType, tkTileProvider Provider = tkTileProvider.ProviderNone, int scale = -1)
 {
     throw new NotImplementedException();
 }
Beispiel #9
0
 /// <summary>
 /// Clears cache of the specified to type for a given provider and scales.
 /// </summary>
 /// <param name="cacheType">Type of cache to be cleared.</param>
 /// <param name="Provider">Tile provider to be cleared. ProviderNone will clear tiles for all providers.</param>
 /// <param name="fromScale">Minimal scale (zoom) to clear tiles for.</param>
 /// <param name="toScale">Maximum scale (zoom) to clear tiles for.</param>
 public void ClearCache2(tkCacheType cacheType, tkTileProvider Provider, int fromScale = 0, int toScale = 100)
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
 /// <summary>
 /// Clears cache of the specified type.
 /// </summary>
 /// <param name="cacheType">Type of cache to be cleared.</param>
 public void ClearCache(tkCacheType cacheType)
 {
     throw new NotImplementedException();
 }
Beispiel #11
0
 /// <summary>
 /// Gets the current size of cache used for specific provider and zoom level.
 /// </summary>
 /// <param name="cacheType">Type of the cache.</param>
 /// <param name="providerId">The provider. -1 will return size for all providers.</param>
 /// <param name="scale">The scale. -1 will return size for all zoom levels.</param>
 /// <returns>The size of cache in MB.</returns>
 public double get_CacheSize2(tkCacheType cacheType, int providerId = -1, int scale = -1)
 {
     throw new NotImplementedException();
 }