Exemplo n.º 1
0
        void lblDownloadData_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var lbl = sender as LinkLabel;

            if (lbl == null)
            {
                return;
            }
            var infoGroup = lbl.Tag as ServiceInfoGroup;

            if (infoGroup == null)
            {
                return;
            }

            if (Popup != null)
            {
                Popup.Close();
            }

            var seriesList = new List <OneSeriesDownloadInfo>(infoGroup.ItemsCount);

            seriesList.AddRange(infoGroup.GetItems().Select(ClassConvertor.ServiceInfoToOneSeriesDownloadInfo));
            var layer = infoGroup.GetItems().First().Layer; // we have at least one element

            var dataThemeName = layer.LegendText;
            var startArgs     = new StartDownloadArg(seriesList, dataThemeName);

            Global.PluginEntryPoint.StartDownloading(startArgs, layer);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts downloading
        /// </summary>
        /// <param name="featureLayer">Layer with features to download</param>
        /// <param name="featuresToDownload">Features to download. If this null, then all features from layer will be processed.</param>
        public void StartDownloading(IFeatureLayer featureLayer, IEnumerable <IFeature> featuresToDownload = null)
        {
            if (featuresToDownload == null)
            {
                featuresToDownload = featureLayer.DataSet.Features;
            }
            var dataThemeName = featureLayer.LegendText;
            var oneSeriesList = featuresToDownload.Select(f => ClassConvertor.IFeatureToOneSeriesDownloadInfo(f, featureLayer)).ToList();
            var startArgs     = new StartDownloadArg(oneSeriesList, dataThemeName);

            StartDownloading(startArgs, featureLayer);
        }
        /// <summary>
        /// Starts downloading
        /// </summary>
        /// <param name="startArgs">Start arguments</param>
        /// <param name="layer">Layer, which contains points to download</param>
        public void StartDownloading(StartDownloadArg startArgs, IFeatureLayer layer)
        {
            if (startArgs == null)
            {
                throw new ArgumentNullException("startArgs");
            }
            if (ShowIfBusy())
            {
                return;
            }

            startArgs.FeatureLayer    = layer;
            startArgs.DownloadOptions = _downloadOptions;
            DownloadManager.Start(startArgs);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Starts downloading
        /// </summary>
        /// <param name="startArgs">Start arguments</param>
        /// <param name="layer">Layer, which contains points to download</param>
        public void StartDownloading(StartDownloadArg startArgs, IFeatureLayer layer)
        {
            if (startArgs == null)
            {
                throw new ArgumentNullException("startArgs");
            }

            var downloadManager = DownloadManager;

            if (downloadManager.IsBusy)
            {
                //todo: inform user about "busy" state?
                return;
            }
            startArgs.Tag = layer; // put layer into tag, we need it in DownloadManager_Completed method
            downloadManager.Start(startArgs);
        }