Beispiel #1
0
 /// <summary>
 /// Saves state of the tree and updates the state of the project
 /// </summary>
 private void TilesForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     tabIndex = this.tabControl1.SelectedIndex;
     TileSettings.SaveTreeState(this.treeView1);
     if (this.state != this.tiles.Serialize())
     {
         mapWin.Project.Modified = true;
     }
 }
        /// <summary>
        /// Creates a new instance of the tile prefetcher
        /// </summary>
        public PrefetcherForm(Extents ext, int provider, string dbFilename)
        {
            InitializeComponent();

            this.btnChangeDiskLocation.Click += new System.EventHandler(this.btnChangeDiskLocation_Click);
            this.btnChoose.Click             += new System.EventHandler(this.btnChoose_Click);
            this.chkSelectAll.CheckedChanged += new System.EventHandler(this.chkSelectAll_CheckedChanged_1);
            this.Ok.Click              += new System.EventHandler(this.Ok_Click_1);
            this.FormClosing           += new System.Windows.Forms.FormClosingEventHandler(this.PrefetcherForm_FormClosing);
            this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);

            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //this.btnTestConnection.Click += new System.EventHandler(this.btnTestConnection_Click);
            //this.chkVisible.CheckedChanged += new System.EventHandler(this.chkVisible_CheckedChanged);

            this.tiles = new MapWinGIS.Tiles();
            tiles.AutodetectProxy();
            this.SetExtents(ext);
            Thread.Sleep(300);

            TileSettings.Read(tiles);
            TileSettings.FillProviderTree(this.treeView1, provider);

            if (dbFilename != "")
            {
                this.tiles.DiskCacheFilename = dbFilename;
            }
            this.txtDatabase.Text = tiles.DiskCacheFilename;

            try
            {
                if (this.treeView1.SelectedNode == null)
                {
                    this.treeView1.SelectedNode = this.treeView1.Nodes[0].Nodes[0].Nodes[0];
                }
            }
            catch (Exception ex) { }
        }
Beispiel #3
0
        /// <summary>
        /// Creates a new instance of the ChooseProviderForm
        /// </summary>
        public TilesForm(MapWinGIS.Interfaces.IMapWin mapWin, Tiles tiles)
        {
            InitializeComponent();

            this.btnChangeDiskLocation.Click += new System.EventHandler(this.btnChangeDiskLocation_Click);
            this.btnRunCaching.Click         += new System.EventHandler(this.btnRunCaching_Click);
            this.chkServer.CheckedChanged    += new System.EventHandler(this.chkServer_CheckedChanged);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TilesForm_FormClosing);
            this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);

            if (mapWin == null)
            {
                throw new ArgumentNullException("Reference to MapWinGIS wasn't passed");
            }

            this.tiles  = tiles;
            this.mapWin = mapWin;
            TileSettings.FillProviderTree(this.treeView1, tiles.ProviderId);

            this.state = tiles.Serialize();

            this.cacheSizeControl1.Init(tiles, tkCacheType.RAM);
            this.cacheSizeControl2.Init(tiles, tkCacheType.Disk);

            string s = tiles.DiskCacheFilename;

            this.txtDiskCachePath.Text = s;

            this.chkServer.Checked  = tiles.UseServer;
            this.chkVisible.Checked = tiles.Visible;

            if (tabIndex >= 0 && tabIndex < tabControl1.TabPages.Count)
            {
                this.tabControl1.SelectedIndex = tabIndex;
            }
        }
 /// <summary>
 /// Saves the state of the tree
 /// </summary>
 private void PrefetcherForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     TileSettings.SaveTreeState(this.treeView1);
 }