コード例 #1
0
        private void DownloadManager_Completed(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                return;
            }

            var dManager  = DownloadManager;
            var themeName = dManager.Information.StartArgs.DataTheme.Name;

            var         _themeManager = new ThemeManager();
            IFeatureSet featureSet;

            try
            {
                featureSet = _themeManager.GetFeatureSet(themeName);
            }
            catch (ArgumentException)
            {
                // No such theme in the database
                featureSet = null;
            }
            if (featureSet == null)
            {
                // in theory this condition always will be false
                if (dManager.Information.WithError != dManager.Information.TotalSeries)
                {
                    MessageBox.Show("Theme not found, but some series was saved!", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                return;
            }

            featureSet.FillAttributes();

            var sourceLayer = (IFeatureLayer)dManager.Information.StartArgs.Tag;
            var lm          = SearchLayerModifier.Create(sourceLayer, (Map)App.Map, this);

            Debug.Assert(lm != null);

            lm.UpdateDataTable(featureSet, DownloadManager);
            lm.UpdateSymbolizing();
            lm.UpdateContextMenu();

            // Check for DataAggregation
            var aggPlugin = App.GetExtension <IDataAggregationPlugin>();

            if (aggPlugin != null)
            {
                aggPlugin.AttachLayerToPlugin(sourceLayer);
            }

            // Refresh list of the time series in the table and graph in the main form
            SeriesControl.RefreshSelection();
        }
コード例 #2
0
        void SerializationManager_Deserializing(object sender, SerializingEventArgs e)
        {
            //try reset projection!
            if (App.Map.MapFrame.Projection != DotSpatial.Projections.KnownCoordinateSystems.Projected.World.WebMercator)
            {
                //App.Map.MapFrame.Reproject(DotSpatial.Projections.KnownCoordinateSystems.Projected.World.WebMercator);
                MapFrameProjectionHelper.ReprojectMapFrame(App.Map.MapFrame, DotSpatial.Projections.KnownCoordinateSystems.Projected.World.WebMercator.ToEsriString());
            }

            myProjectManager.OpeningProject();
            Shell.Text = string.Format("{0} - {1}", HYDRODESKTOP_NAME, GetProjectShortName());
            //setup new db information
            SeriesControl.SetupDatabase();
            if (App.Map.Projection != null)
            {
                latLongDisplay.MapProjectionString = App.Map.Projection.ToEsriString();
            }
        }
コード例 #3
0
 private void Refresh()
 {
     SeriesControl.RefreshSelection();
 }