コード例 #1
0
        /// <summary>
        /// The ax map 1 file dropped.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void AxMap1FileDropped(object sender, _DMapEvents_FileDroppedEvent e)
        {
            this.statusStripProgressBar.Value = 0;

            this.statusStripProgressLabel.Text = @"Adding " + Path.GetFileName(e.filename);

            // TODO use async:
            var hndl = this.axMap1.AddLayerFromFilename(e.filename, tkFileOpenStrategy.fosAutoDetect, true);

            if (hndl == -1)
            {
                this.ProgressTextbox.AppendText(
                    "Failed to open datasource: " + this.axMap1.FileManager.ErrorMsg[this.axMap1.FileManager.LastErrorCode]);
                return;
            }

            // Set main form up front:
            this.Activate();

            this.AddToLegend(hndl);

            this.SetStatusstripControls();

            this.statusStripProgressLabel.Text = @"Done";
        }
コード例 #2
0
 /// <summary>
 /// The file dropped of the map control
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void AxMap1FileDropped(object sender, _DMapEvents_FileDroppedEvent e)
 {
     Helpers.LayerHelper.AddLayer(this.axMap1.FileManager.Open(e.filename));
 }
コード例 #3
0
ファイル: MapEvents.cs プロジェクト: zylimit/MapWindow5
 private void MapFileDropped(object sender, _DMapEvents_FileDroppedEvent e)
 {
     Invoke(sender, FileDropped, new FileDroppedEventArgs(e.filename));
 }
コード例 #4
0
 private void axMap1_FileDropped(object sender, _DMapEvents_FileDroppedEvent e)
 {
     txtResults.Text += $@"Opening {e.filename} after dropping.";
     axMap1.AddLayerFromFilename(e.filename, tkFileOpenStrategy.fosAutoDetect, true);
 }