/// <summary>
        /// Sets up the file/folder dialog depending on the file type requested for import
        /// </summary>
        /// <param name="sender"> the browse button</param>
        /// <param name="e"></param>
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            if (fileType.Equals("access"))
            {
                openFileDialog                  = new OpenFileDialog();
                openFileDialog.Filter           = filter;
                openFileDialog.FilterIndex      = 2;
                openFileDialog.Title            = "Browse Files";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.DefaultExt       = "mdb | accdb";
            }
            else if (fileType.Equals("exf"))
            {
                openFileDialog                  = new OpenFileDialog();
                openFileDialog.Filter           = filter;
                openFileDialog.FilterIndex      = 2;
                openFileDialog.Title            = "Browse Files";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.DefaultExt       = "exf";
            }
            else if (fileType.Equals("photos"))
            {
                browseFolderDialog = new FolderBrowserDialog();
                if (browseFolderDialog.ShowDialog() == DialogResult.OK)
                {
                    mfilePath      = browseFolderDialog.SelectedPath;
                    txtDBName.Text = mfilePath;
                }
                else
                {
                    Close();
                    mParent.BringToFront();
                }
            }
            else if (fileType.Equals("shape"))
            {
                openFileDialog                  = new OpenFileDialog();
                openFileDialog.Filter           = filter;
                openFileDialog.FilterIndex      = 2;
                openFileDialog.Title            = "Browse Files";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.DefaultExt       = "shp";
            }

            //TODO temp hack to handle folder dialog vs file dialog
            if (openFileDialog != null)
            {
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    mfilePath      = openFileDialog.FileName;
                    txtDBName.Text = mfilePath;
                }
                else
                {
                    Close();
                }
            }
        }
Exemplo n.º 2
0
 private void btnGeotag_Click(object sender, EventArgs e)
 {
     //mParent.mFiles = Directory.GetFiles(inPath);
     Close();
     mParent.BringToFront();;
     writeGeoTag(mDataPath, mInPath, mOutPath, mLayer, mColor, mAllRecords);
 }