예제 #1
0
        private void OnDownloadClick(object sender, EventArgs e)
        {
            GpsDownloadForm dlg = new GpsDownloadForm();

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                GpsBabelCommunicator gpsCommunicator = new GpsBabelCommunicator();
                gpsCommunicator.GpsBabelWrapper.GpsBabelPath = Path.Combine(Settings.Instance.GPSBabelPath, "gpsbabel.exe");
                gpsCommunicator.GpsBabelWrapper.InputPort    = dlg.InputPort;
                gpsCommunicator.GpsBabelWrapper.SourceType   = dlg.SourceType;

                try
                {
                    Project.ImportFiles(gpsCommunicator.DownloadGpsData());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.Message, "Error downloading.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #2
0
        private void OnDownloadClick(object sender, EventArgs e)
        {
            GpsDownloadForm dlg = new GpsDownloadForm();
            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                GpsBabelCommunicator gpsCommunicator = new GpsBabelCommunicator();
                gpsCommunicator.GpsBabelWrapper.GpsBabelPath = Path.Combine(Settings.Instance.GPSBabelPath, "gpsbabel.exe");
                gpsCommunicator.GpsBabelWrapper.InputPort = dlg.InputPort;
                gpsCommunicator.GpsBabelWrapper.SourceType = dlg.SourceType;

                try
                {
                    Project.ImportFiles(gpsCommunicator.DownloadGpsData());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.Message, "Error downloading.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }