Example #1
0
        public string PickExistingFile(PickingData data)
        {
            return(QFileDialog.GetOpenFileName(
                       (Central.Manager.IDE as LinuxIDE),
                       "Select File",
                       Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                       "All Files (*.*)"
                       ));

            /*FileChooserDialog fcd = new FileChooserDialog(
             *  "Select File",
             *  (Central.Manager.IDE as LinuxIDE),
             *  FileChooserAction.Open,
             *  "Cancel", ResponseType.Cancel,
             *  "Open", ResponseType.Accept);
             * fcd.Filter = new FileFilter();
             * string[] f = data.Filter.Split(new char[] { '|' });
             * for (int i = 0; i < f.Length; i += 2)
             *  fcd.Filter.AddPattern(f[i + 1]);
             * string result = null;
             * if (fcd.Run() == (int)ResponseType.Accept)
             *  result = fcd.Filename;
             * fcd.Destroy();
             * return result;*/
        }
Example #2
0
        public string PickExistingFile(PickingData data)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter           = data.Filter;
            ofd.CheckFileExists  = data.CheckFileExists;
            ofd.CheckPathExists  = data.CheckPathExists;
            ofd.RestoreDirectory = data.RestoreDirectory;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                return(ofd.FileName);
            }
            else
            {
                return(null);
            }
        }