コード例 #1
0
        public TileSelectionPage(MainPage enclosing, TileSelection selection)
        {
            InitializeComponent();

            this.enclosing = enclosing;
            this.SelectedTile = selection;

            this.textName.Text = selection.Name;
            this.checkAerial.IsChecked = selection.HasAerial;
            this.checkAerial.IsEnabled = !selection.HasAerial;
            this.checkRoad.IsChecked = selection.HasRoad;
            this.checkRoad.IsEnabled = !selection.HasRoad;

            this.sliderLevel.Minimum = this.enclosing.TileLayer.MinZoomLevel;
            this.sliderLevel.Maximum = this.enclosing.TileLayer.MaxZoomLevel;
            this.sliderLevel.Value = this.SelectedTile.MaxLevel;

            this.UpdateTileList();
            this.UpdateSummary();
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: linjus/bingshin
        void mapMain_SelectionDoneEvent(object sender, MouseButtonEventArgs e)
        {
            var aerialmode = this.mapMain.Mode is AerialMode;
            var roadmode = this.mapMain.Mode is RoadMode;

            var name = "Selection " + (this.tileselections.Count + 1).ToString();
            var selection = new TileSelection(name, this.mapMain.Selection, this.tilelayer, aerialmode, roadmode);

            var subpage = new TileSelectionPage(this, selection);
            subpage.Closed += new EventHandler(tileselectionpage_Closed);
            subpage.Show();

            this.IsEnabled = false;
        }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: linjus/bingshin
        private void BeginDownload(TileSelection selection, DoWorkEventArgs e)
        {
            foreach (var quadkey in selection.Tiles) {
                if (this.downloadworker.CancellationPending) {
                    e.Cancel = true;
                    break;
                }

                if (selection.HasAerial)
                    this.SaveTile(quadkey, Repository.MapStyle.Hybrid);
                if (selection.HasRoad)
                    this.SaveTile(quadkey, Repository.MapStyle.Road);

                this.downloadworker.ReportProgress((int)(100.0 * this.downloadercontext.NumSuccess / this.downloadercontext.NumWorks));
            }
        }