Exemple #1
0
 private void txtFilename_ButtonClicked(object sender, EventArgs e)
 {
     using (var d = new OpenFileDialog())
     {
         d.FileName = Filename;
         d.Filter   = ImportManager.GetSupportedFilters();
         if (d.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         if (Filename == d.FileName)
         {
             return;
         }
         Filename = d.FileName;
         Options  = string.Empty;
     }
 }
        private void btnBrowseFile_Click(object sender, EventArgs e)
        {
            try
            {
                FormUtil.Busy(this, true);

                using (var d = new OpenFileDialog())
                {
                    d.Filter   = ImportManager.GetSupportedFilters();
                    d.FileName = Filename;
                    d.Title    = "Open Data File...";
                    //d.Filter = "";

                    if (d.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }

                    Filename = d.FileName;
                    if (FileSupportsTables(Filename))
                    {
                        EnableGroup("Filename", "Tablename");
                        UpdateTableList();
                    }
                    else
                    {
                        EnableGroup("Filename");
                    }
                }
            }
            catch (Exception ex)
            {
                FormUtil.WinException(ex);
            }
            finally
            {
                FormUtil.Busy(this, false);
            }
        }