Ejemplo n.º 1
0
        private string GetPlaybackXmlPath()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.CheckFileExists  = true;
            ofd.Multiselect      = false;
            ofd.Filter           = "HST files (*.hst)|*.hst|GPX files (*.gpx)|*.gpx|XML files (*.xml)|*.xml";
            ofd.RestoreDirectory = true;
            ofd.Title            = "Input biking log file";

            DialogResult result = ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                string fileExtension = System.IO.Path.GetExtension(ofd.FileName).ToUpper();
                if (fileExtension == ".GPX")
                {
                    m_playbackFormat = GPSPlaybackFormat.GPX;
                }
                else if (fileExtension == ".HST")
                {
                    m_playbackFormat = GPSPlaybackFormat.HST;
                }
                else if (fileExtension == ".XML")
                {
                    m_playbackFormat = GPSPlaybackFormat.XML;
                }

                return(ofd.FileName);
            }

            return(string.Empty);
        }
    private string GetPlaybackXmlPath()
    {
      OpenFileDialog ofd = new OpenFileDialog();
      ofd.CheckFileExists = true;
      ofd.Multiselect = false;
			ofd.Filter = "HST files (*.hst)|*.hst|GPX files (*.gpx)|*.gpx|XML files (*.xml)|*.xml";
      ofd.RestoreDirectory = true;
      ofd.Title = "Input biking log file";

      DialogResult result = ofd.ShowDialog();
      if (result == DialogResult.OK)
      {
        string fileExtension = System.IO.Path.GetExtension(ofd.FileName).ToUpper();
        if (fileExtension == ".GPX")
          m_playbackFormat = GPSPlaybackFormat.GPX;
        else if (fileExtension == ".HST")
          m_playbackFormat = GPSPlaybackFormat.HST;
        else if (fileExtension == ".XML")
          m_playbackFormat = GPSPlaybackFormat.XML;

        return ofd.FileName;
      }

      return string.Empty;
    }