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
 private void Refresh()
 {
     SeriesControl.RefreshSelection();
 }