Beispiel #1
1
 private void btnBrowser_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog path = new FolderBrowserDialog();
     //path.RootFolder = Environment.SpecialFolder.;
     path.ShowDialog();
     txtFrom.Text = path.SelectedPath;
 }
 private void btnChooseDir_Click(object sender, RoutedEventArgs e)
 {
     var dialog = new FolderBrowserDialog();
     dialog.ShowDialog();
     if (dialog.SelectedPath.IsNullOrEmpty()) return;
     MainData.Path = dialog.SelectedPath;
 }
		static void SetFolderBrowserProperties (SelectFileDialogData data, FolderBrowserDialog dialog)
		{
			if (!string.IsNullOrEmpty (data.Title))
				dialog.Description = data.Title;
			
			dialog.SelectedPath = data.CurrentFolder;
		}
 private void BtnExportAll_Click(object sender, System.EventArgs e)
 {
     using (FolderBrowserDialog browserDlg = new FolderBrowserDialog())
     {
         browserDlg.Description = "Export all files";
         if (browserDlg.ShowDialog() == DialogResult.OK)
         {
             foreach (OContainer.fileEntry file in container.content)
             {
                 string fileName = Path.Combine(browserDlg.SelectedPath, file.name);
                 string dir = Path.GetDirectoryName(fileName);
                 if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
                 if (file.loadFromDisk)
                 {
                     byte[] buffer = new byte[file.fileLength];
                     container.data.Seek(file.fileOffset, SeekOrigin.Begin);
                     container.data.Read(buffer, 0, buffer.Length);
                     File.WriteAllBytes(fileName, buffer);
                 }
                 else
                     File.WriteAllBytes(fileName, file.data);
             }
         }
     }
 }
        private void btnInputFolder_Click(object sender, RoutedEventArgs e)
        {
            var fbd = new FolderBrowserDialog
            {
                SelectedPath =
                    Directory.Exists(txtInputFolder.Text)
                        ? txtInputFolder.Text
                        : VariousFunctions.GetApplicationLocation()
            };
            if (fbd.ShowDialog() != DialogResult.OK) return;

            SelectedPlugins.Clear();
            txtInputFolder.Text = fbd.SelectedPath;

            var di = new DirectoryInfo(txtInputFolder.Text);
            FileInfo[] fis = di.GetFiles();
            foreach (
                FileInfo fi in
                    fis.Where(
                        fi =>
                            (fi.Name.EndsWith(".asc") || fi.Name.EndsWith(".alt") || fi.Name.EndsWith(".ent") || fi.Name.EndsWith(".xml")) &&
                            Path.GetFileNameWithoutExtension(fi.Name).Length == 4))
            {
                SelectedPlugins.Add(new PluginEntry
                {
                    IsSelected = true,
                    LocalMapPath = fi.FullName,
                    PluginClassMagic = fi.Name.Remove(fi.Name.Length - 3)
                });
            }
        }
 /// <summary>
 /// Constructor with dialog description</summary>
 /// <param name="description">Dialog description</param>
 public FolderBrowserDialogUITypeEditor(string description)
 {
     // create instance of editing control, 
     // resuse this instance for subsequence calls
     m_dialog = new FolderBrowserDialog();
     m_dialog.Description = description;
 }
Beispiel #7
1
        private void cmdBatch_Click(object sender, EventArgs e)
        {
            try
            {
                FolderBrowserDialog dlgFolder = new FolderBrowserDialog();

                dlgFolder.Description = "Batch files all image files from this folder.";

                if (dlgFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    DirectoryInfo dirInfo = new DirectoryInfo(dlgFolder.SelectedPath.ToString());

                    FileInfo[] ImageFiles = dirInfo.GetFiles("*.jpg").Concat(dirInfo.GetFiles("*.jpeg")).Concat(dirInfo.GetFiles("*.png")).ToArray();

                    for (int i = 0; i < ImageFiles.Length; ++i)
                    {
                        FileInfo ImageFile = ImageFiles[i];
                        Bitmap ImageBitmap = new Bitmap(ImageFile.FullName);

                        ProcessImage(ImageBitmap);
                    }

                    MessageBox.Show("Image Files Process Completed", "Process Completed", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                LogException(ex);
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            openFolderDialog = new FolderBrowserDialog();
            openFolderDialog.Description = "Podaj katalog z przykładami";
            openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "*JPEG|*.jpg|Wszystkie pliki|*.*";
            openFileDialog.Title = "Podaj plik przeznaczony do rozponania";

            ojIterations = 10;
            iterationsText.Text = ojIterations.ToString();
            printLineDelegate = printByDispatcher;
            saveImagesDelegate = saveImages;
            createLearningExamplesDelegate = createLearningExamples;
            getFilesDelegate = getFiles;
            setExamplesDelegate = setExamples;
            OnStateChange = stateChange;
            OnReductionFinished = reductionFinished;
            OnReductionStarted = reductionStarted;
            files = null;
            learnButton.IsEnabled = false;
            compareButton.IsEnabled = false;
            outputDimension = 7;
            dimensionText.Text = outputDimension.ToString();

            dataBaseFileName = "C:\\database.db";
            dataBasePathText.Text = dataBaseFileName;
            getDataBaseFileNameDelegate += DBFN;

            examplesHeight = 0;
            examplesWidth = 0;
        }
Beispiel #9
1
 private void btnExport_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog fbd = new FolderBrowserDialog();
     DialogResult result = fbd.ShowDialog();
     if (result == DialogResult.Cancel) {
         //do nothing, cancel was clicked
     } else if (fbd.SelectedPath != null) {
         if (Directory.GetFiles(fbd.SelectedPath).Length == 0) {
             int count = 0;
             foreach (ListViewItem item in lvExport.Items) {
                 try {
                     string source = item.ImageKey + @"\" + item.SubItems[3].Text + ".jpg";
                     string destination = fbd.SelectedPath + @"\"
                         + item.SubItems[1].Text + "-"       //firstname
                         + item.Text + "-"                   //last name
                         + item.SubItems[2].Text + "-"       //grade
                         + item.SubItems[3].Text             //ID
                         + ".jpg";
                     File.Copy(source, destination);
                     count++;
                 } catch (Exception) {
                     //skip that one, probably an IOException due to file exists already
                     //HOWEVER, 2013-14 missed 1 file
                 }
             }
             MessageBox.Show("Copied " + count + " picture" + (count == 1 ? "." : "s."));
         } else {
             string error = "Files exist in the folder you selected.\n\nPlease create or select an empty folder and try again.";
             string caption = "Choose an Empty Folder";
             MessageBox.Show(error, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
        public void Execute(IMenuCommand command)
        {
            IDiagram diagram = this.DiagramContext.CurrentDiagram;
            IModelStore modelStore = diagram.ModelStore;

            string SqlFile = @"C:\MyLoStore\MyLoStorePostgres.sql";
            string PythonFile = @"C:\MyLoStore\MyLoStore.py";

            FolderBrowserDialog openFolderDialog1 = new FolderBrowserDialog();
            openFolderDialog1.RootFolder = Environment.SpecialFolder.MyComputer;
            openFolderDialog1.Description =
                "Select the directory that you want to use for generated output";

            if (openFolderDialog1.ShowDialog() == DialogResult.OK)
            {
                string folderName = openFolderDialog1.SelectedPath;
                SqlFile = folderName + @"\MyLoStorePostgres.sql";
                PythonFile = folderName + @"\MyLoStore.py";

                using (StreamWriter fsSql = new StreamWriter(SqlFile, false))
                {
                    using (StreamWriter fsPy = new StreamWriter(PythonFile, false))
                    {

                        SQLWriter mySql = new SQLWriter(SQLGenerateRun.Postgres);
                        PythonClassWriter py = new PythonClassWriter();
                        SQLGenerator sqlGen = new SQLGenerator(fsSql, mySql, fsPy, py, modelStore);
                        sqlGen.GenerateMySQL();
                    }
                }
            }
        }
Beispiel #11
1
        private void btnNew_Click(object sender, EventArgs e)
        {
            // 获取文件夹绝对路径    显示在 txtbox 控件里

            System.Windows.Forms.FolderBrowserDialog folder = new System.Windows.Forms.FolderBrowserDialog();

            string StrFileName = "";
            // 获取文件和路径名 一起显示在 txtbox 控件里

            OpenFileDialog dialog = new OpenFileDialog();
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string SavePathFile = AppDomain.CurrentDomain.BaseDirectory + "\\image\\gdc" +DateTime.Now.ToString("yyyyMMddHHmmss")+ ".jpg";
                StrFileName = dialog.SafeFileName;
                if (File.Exists(SavePathFile))
                {
                    File.Delete(SavePathFile);
                } File.Copy( dialog.FileName,SavePathFile);
                if (!db.InsertH_Para("H_gdc", "gdc" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".jpg", db.GetMaxID("gdc", "H_gdc")))
                {
                    MessageBox.Show("保存失败!"); return;
                }
                else
                {
                    MessageBox.Show("保存成功!");
                    ShowDt(PageInt);
                }
            }
        }
Beispiel #12
1
        private void BrowseClick(object sender, EventArgs e)
        {
            var browseDialog = new FolderBrowserDialog();

            if (browseDialog.ShowDialog() == DialogResult.OK)
                Directory.Text = browseDialog.SelectedPath;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // Der Dialog zur Auswahl eines beliebigen Log-Verzeichnisses wird angeboten.

            System.Windows.Forms.FolderBrowserDialog objDialog = new FolderBrowserDialog();
            objDialog.Description = "Wählen Sie ein Exportverzeichnis. \nDer Inhalt einer evtl. vorhandenen Datei wird überschrieben.";
            objDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            // Nur wenn in dem FolderBrowserDialog tatsächlich mit OK ein Pfad gewählt wurde,
            // kommt es zum Export.

            if (objDialog.ShowDialog() == DialogResult.OK)
            {
                // Export

                string exportverzeichnis = Path.Combine(objDialog.SelectedPath, "alias.csv");

                TextWriter tw = new StreamWriter(exportverzeichnis);

                for (int i = 0; i < Global.AliasMail.Count(); i++)
                {
                    tw.WriteLine("" + Global.AliasMail[i].Email + ", " + Global.AliasMail[i].Kürzel + ", " + Global.AliasMail[i].Name + ", " + Global.AliasMail[i].Alias1 + ", " + Global.AliasMail[i].Alias2 + ", " + Global.AliasMail[i].Alias3 + ", " + Global.AliasMail[i].Alias4 + "");
                }
                tw.Close();
            }
        }
 public CleaningInterface()
 {
     InitializeComponent();
     this.m_directoryBrowser = new FolderBrowserDialog();
     this.registry = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"Software\FileNameCleaner");
     this.SetDirectory(this.LastDirectory);
 }
        private void btnPackInputBrowse_Click(object sender, System.EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                tbPackInput.Text = fbd.SelectedPath;
        }
 private void BrowseButtonOnClick(object sender, EventArgs eventArgs)
 {
     FolderBrowserDialog fbd = new FolderBrowserDialog();
     if (fbd.ShowDialog() == DialogResult.OK){
         textBox1.Text = fbd.SelectedPath;
     }
 }
Beispiel #17
1
 private void button10_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog dlg = new FolderBrowserDialog();
     dlg.SelectedPath = Application.StartupPath + "\\Output";
     dlg.ShowDialog();
     textBox8.Text = dlg.SelectedPath;
 }
		private void btnBrowseDir_Click(object sender, RoutedEventArgs e) {
			var dialog = new FolderBrowserDialog {
				Description = "Select the directory containing PCSX2"
			};
			if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				tbPcsx2Dir.Text = dialog.SelectedPath;
		}
        private void FolderStore_Click(object sender, RoutedEventArgs e)
        {
            FolderBrowserDialog FolderDialog = new FolderBrowserDialog();
            FolderDialog.ShowDialog();

            FolderSave = FolderDialog.SelectedPath;
        }
Beispiel #20
0
        private void button2_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
            if (!String.IsNullOrEmpty(textBox2.Text))
            {
                folderBrowser.SelectedPath = textBox2.Text;
            }
            folderBrowser.ShowDialog();

            if (!String.IsNullOrEmpty(folderBrowser.SelectedPath))
            {
                listBox1.Items.Clear();
                textBox2.Text = folderBrowser.SelectedPath;

                DirectoryInfo directoryInfo = new DirectoryInfo(folderBrowser.SelectedPath);
                foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                {
                    Console.WriteLine("Extension : " + fileInfo.Extension);
                    if (fileInfo.Extension.ToLower().Equals(".apk"))
                    {
                        listBox1.Items.Add(fileInfo);
                    }
                }
            }
        }
Beispiel #21
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            btn_New.Enabled = false;//将新建按钮设置为不可用
            ThreadPool.QueueUserWorkItem(//开始线程池
                (pp) =>
                {
                    object G_missing = System.Reflection.Missing.Value;
                    object G_str_path = System.Reflection.Missing.Value;
                    Word.Application G_wa = new Microsoft.Office.Interop.Word.Application();//创建应用程序对象
                    object P_obj = "Normal.dot";//定义文档模版

                    FolderBrowserDialog G_FolderBrowserDialog = new FolderBrowserDialog();
                    Word.Document P_wd = G_wa.Documents.Add(ref P_obj, ref G_missing, ref G_missing, ref G_missing);
                    G_str_path = string.Format(//计算文件保存路径
                        @"{0}\{1}",G_FolderBrowserDialog.SelectedPath,DateTime.Now.ToString("yyyy年M月d日h时s秒fff毫秒")+".doc"
                        );
                    P_wd.SaveAs(
                        ref G_str_path,
                        ref G_missing,ref G_missing,ref G_missing,ref G_missing,
                        ref G_missing,ref G_missing,ref G_missing,ref G_missing,
                        ref G_missing,ref G_missing,ref G_missing,ref G_missing,
                        ref G_missing,ref G_missing,ref G_missing
                        );

                    ((Word.Application)G_wa.Application).Quit(ref G_missing, ref G_missing, ref G_missing);
                    this.Invoke(
                        (MethodInvoker)(()=>
                            {
                                MessageBox.Show("Word文档已经建立!","提示!");
                                btn_diplay.Enabled = true;
                            }
                            )
                        );
                });
        }
Beispiel #22
0
 private void BrowseSource_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog dialog = new FolderBrowserDialog();
     dialog.SelectedPath = PushDestination.Text;
     if (dialog.ShowDialog() == DialogResult.OK)
         PushDestination.Text = dialog.SelectedPath;
 }
 public Settings()
 {
     InitializeComponent();
     steam_txb.Text = Properties.Settings.Default.steamDir;
     shortcut_txb.Text = Properties.Settings.Default.shortcutDir;
     fbd = new FolderBrowserDialog();
 }
 private void browseButton_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog folderDialog = new FolderBrowserDialog();
     DialogResult result = folderDialog.ShowDialog();
     if (result == DialogResult.OK)
         pathTextBox.Text = folderDialog.SelectedPath;
 }
Beispiel #25
0
        private void btnLoadData_Click(object sender, EventArgs e)
        {
            using (FolderBrowserDialog dlgFolder = new FolderBrowserDialog())
            {
                if (dlgFolder.ShowDialog() == DialogResult.OK)
                {

                    for (int i = 0; i < this.feretDataSet.faces.Rows.Count; i++)
                    {
                        this.feretDataSet.faces.Rows[i].Delete();

                    }

                    updateDatabase();

                    BackgroundWorker worker = new BackgroundWorker();
                    worker.WorkerReportsProgress = true;
                    worker.DoWork += new DoWorkEventHandler(worker_DoWork);
                    worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
                    worker.RunWorkerAsync(dlgFolder.SelectedPath);

                    lstInfo.Enabled = false;
                    //lstSelect.Enabled = false;
                    btnLoadData.Enabled = false;
                    btnSaveSetList.Enabled = false;
                    dataGridView1.Enabled = false;
                }

            }
        }
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            var dialog =
                new FolderBrowserDialog
                    {
                        Description = "Select a folder",
                        RootFolder = Environment.SpecialFolder.Desktop,
                        ShowNewFolderButton = false
                    };
            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                var folder = dialog.SelectedPath;

                // Check for duplicates
                var bDuplicate = false;
                foreach (ListViewItem item in m_lstFolders.Items)
                {
                    if (string.Compare(folder, item.Text, StringComparison.OrdinalIgnoreCase) != 0)
                        continue;

                    bDuplicate = true;
                    break;
                }

                // Add item to ListView
                if (!bDuplicate)
                    m_lstFolders.Items.Add(folder);
            }
            dialog.Dispose();
        }
Beispiel #27
0
 private void btnSelectFolder_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog dlg = new FolderBrowserDialog();
     if (dlg.ShowDialog(this) != DialogResult.OK)
         return;
     txtDestFolder.Text = dlg.SelectedPath;
 }
        /// <summary>
        /// Opens a a FolderBrowserDialog with the path in "getter" preselected and 
        /// if the DialogResult.OK is returned uses "setter" to set the path
        /// </summary>
        /// <param name="getter"></param>
        /// <param name="setter"></param>
        public void ShowFolderBrowserDialogWithPreselectedPath(Func<string> getter, Action<string> setter)
        {
            string directoryInfoPath = null;
            try
            {
                directoryInfoPath = new DirectoryInfo(getter()).FullName;
            }
            catch (Exception)
            {
                // since the DirectoryInfo stuff is for convenience we swallow exceptions
            }

            using (var dialog = new FolderBrowserDialog
            {
                RootFolder = Environment.SpecialFolder.Desktop,
                // if we do not use the DirectoryInfo then a path with slashes instead of backslashes won't work
                SelectedPath = directoryInfoPath ?? getter()
            })
            {
                // TODO: do we need ParentForm or is "this" ok?
                if (dialog.ShowDialog(ParentForm) == DialogResult.OK)
                {
                    setter(dialog.SelectedPath);
                }
            }
        }
 private void BtnBrowseFolder_Click(object sender, EventArgs e)
 {
     using (FolderBrowserDialog dlg = new FolderBrowserDialog())
     {
         if (dlg.ShowDialog() == DialogResult.OK) TxtOutFolder.Text = dlg.SelectedPath;
     }
 }
Beispiel #30
0
 private void Button_Select_Click(Object sender, RoutedEventArgs e)
 {
     using (var d = new FolderBrowserDialog()) {
         var r = d.ShowDialog();
         if (r == System.Windows.Forms.DialogResult.OK) FolderLocation.Text = d.SelectedPath;
     }
 }
Beispiel #31
0
 /// <summary>
 /// 选择媒体路径
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button16_Click(object sender, EventArgs e)
 {
     MediaType = "Null";
     System.Windows.Forms.FolderBrowserDialog foldBrowerDialog = new System.Windows.Forms.FolderBrowserDialog();
     foldBrowerDialog.ShowDialog();
     if (!string.IsNullOrEmpty(foldBrowerDialog.SelectedPath))
     {
         txt_UpmediaPath.Text = foldBrowerDialog.SelectedPath + "\\";
     }
     if (!string.IsNullOrEmpty(txt_UpmediaPath.Text))
     {
         if (Directory.Exists(txt_UpmediaPath.Text))
         {
             string[] filename = Directory.GetFiles(txt_UpmediaPath.Text);
             foreach (string name in filename)
             {
                 if (name.Substring(name.LastIndexOf("\\") + 1) == "SlipCustomerList.xml")
                 {
                     rtx_uploadmessage.Text = "此文件夹中的是优惠券!请点击右边按钮进行上传!";
                     MediaType = "SlipCustomer";
                     break;
                 }
                 else if (name.Substring(name.LastIndexOf("\\") + 1) == "playList.xml")
                 {
                     rtx_uploadmessage.Text = "此文件夹中的是播放列表!请点击右边按钮进行上传!";
                     MediaType = "PlayList";
                     break;
                 }
                 else if (name.Substring(name.LastIndexOf("\\") + 1) == "TemplateInfo.xml")
                 {
                     rtx_uploadmessage.Text = "此文件夹中的是打印凭条!请点击右边按钮进行上传!";
                     MediaType = "PrintTemplate";
                     break;
                 }
             }
             if (MediaType == "Null")
             {
                 rtx_uploadmessage.Text = "此文件夹不包含媒体信息,请重新选择!";
             }
         }
         else
         {
             rtx_uploadmessage.Text = "此文件夹不存在!";
         }
     }
 }
Beispiel #32
0
 private string SelectFolder(string path = null, bool newFolder = false)
 {
     WF.FolderBrowserDialog Browser = new WF.FolderBrowserDialog();
     Browser.ShowNewFolderButton = newFolder;
     if (path != null && System.IO.Directory.Exists(path)) Browser.SelectedPath = path;
     else Browser.SelectedPath = System.AppDomain.CurrentDomain.BaseDirectory;
     WF.DialogResult Result = Browser.ShowDialog();
     if (Result == WF.DialogResult.OK)
     {
         string folder = Browser.SelectedPath;
         if (System.IO.Directory.Exists(folder))
         {
             return folder;
         }
     }
     return null;
 }
Beispiel #33
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new System.Windows.Forms.FolderBrowserDialog();



            dialog.Description  = "select the folder with the SILAB LCT data...";
            dialog.SelectedPath = folderTB.Text;

            DialogResult result = dialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                folderTB.Text = dialog.SelectedPath + System.IO.Path.DirectorySeparatorChar;
                refreshFileScan();
            }
        }
Beispiel #34
0
        public static string GetFolderPath()//获取文件目录
        {
            using (Forms.FolderBrowserDialog FolderBrowser = new Forms.FolderBrowserDialog())
            {
                FolderBrowser.Description = "请选择保存目录";

                if (FolderBrowser.ShowDialog() == Forms.DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(FolderBrowser.SelectedPath))
                    {
                        Forms.MessageBox.Show("文件夹路径不能为空", "提示");
                        return(null);
                    }
                }
                return(FolderBrowser.SelectedPath);
            }
        }
Beispiel #35
0
        private async void SaveAllEndButton_Click(object sender, RoutedEventArgs e)
        {
            var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog()
            {
                Description = "保存先フォルダを選択",
            };

            folderBrowserDialog.ShowDialog();
            var folder = folderBrowserDialog.SelectedPath;

            var saveFileWriter = new SaveFileWriter(folder);

            foreach (var std in StationReader.GetAllEnds())
            {
                await saveFileWriter.SaveTrainData(std.StationId);
            }
        }
Beispiel #36
0
        private void btnAddMoveLocation_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.FolderBrowserDialog ofd = new System.Windows.Forms.FolderBrowserDialog();
            ofd.ShowNewFolderButton = true;
            ofd.Description         = "Select Folder.";

            ofd.ShowNewFolderButton = false;
            ofd.ShowNewFolderButton = true;

            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                lsbMoveLocation.Items.Add(ofd.SelectedPath);
                myPI.AddMoveToFolders(ofd.SelectedPath);

                myPI.SaveData();
            }
        }
Beispiel #37
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
     {
         dialog.SelectedPath = (@"C:\work\temp\images\simple2");
         System.Windows.Forms.DialogResult result = dialog.ShowDialog();
         if (result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrWhiteSpace(dialog.SelectedPath))
         {
             rec2.Visibility   = Visibility.Hidden;
             label8.Visibility = Visibility.Hidden;
             //label10.Visibility = Visibility.Hidden; // hide "movie files" label
             files = Directory.GetFiles(dialog.SelectedPath);
             setFiles(dialog.SelectedPath, dialog);
             LoadNewImage(files.ElementAt(1));
         }
     }
 }
        private void changeCacheDirectoryButton_Click(object sender, RoutedEventArgs e)
        {
            var dirDialog = new WinForms.FolderBrowserDialog
            {
                RootFolder   = Environment.SpecialFolder.Desktop,
                SelectedPath = Cache.CacheDirectory.Replace("/", "\\")                 //because windows...
            };

            var dialogResult = dirDialog.ShowDialog();

            if (dialogResult == WinForms.DialogResult.OK)
            {
                Cache.CacheDirectory = dirDialog.SelectedPath;
            }

            UpdateCacheView();
        }
        private void SaveDirectory_Click(object sender, RoutedEventArgs e)
        {
            WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog();
            folderDialog.ShowNewFolderButton = true;
            folderDialog.SelectedPath        = System.AppDomain.CurrentDomain.BaseDirectory;
            WinForms.DialogResult result = folderDialog.ShowDialog();

            if (result == WinForms.DialogResult.OK)
            {
                //----< Selected Folder >----
                //< Selected Path >
                String sPath = folderDialog.SelectedPath;
                Console.WriteLine(sPath);
                saveDirectoryText.Text = sPath;
                //</ Selected Path >
            }
        }
        private void btnSelectSourceFolder_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new System.Windows.Forms.FolderBrowserDialog();

            if (cmbSourceFolder.Text != "")
            {
                dialog.SelectedPath = replaceInstallerFolder(cmbSourceFolder.Text, txtSaveFolder.Text);
            }

            System.Windows.Forms.DialogResult result = dialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                cmbSourceFolder.Text = dialog.SelectedPath;
                cmbSourceFolder.Text = removeCommonPart(cmbSourceFolder.Text, txtSaveFolder.Text);
            }
        }
Beispiel #41
0
 private void Php_path_btn_Click(object sender, RoutedEventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择 浏览器 所在文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             System.Windows.MessageBox.Show(this, "文件夹路径不能为空", "提示");
             return;
         }
         else
         {
             box_php_path.Text = dialog.SelectedPath;
         }
     }
 }
Beispiel #42
0
 private void Set_btn_download_path_Click(object sender, RoutedEventArgs e)
 {
     WinForm.FolderBrowserDialog dialog = new WinForm.FolderBrowserDialog();
     dialog.Description = "请选择下载文件夹";
     if (dialog.ShowDialog() == WinForm.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show(this, "文件夹路径不能为空", "提示");
             return;
         }
         else
         {
             set_box_download_path.Text = dialog.SelectedPath;
         }
     }
 }
Beispiel #43
0
        private System.Windows.Forms.FolderBrowserDialog browseForDirectory(String path)
        {
            // Create OpenFileDialog
            System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog();

            // If there is a path, open to that path first
            if (txtConfigPath.Text == "")
            {
                ;
            }
            else
            {
                dlg.SelectedPath = txtConfigPath.Text;
            }

            return(dlg);
        }
Beispiel #44
0
        private void WorkFolderSelect_Click(object sender, RoutedEventArgs e)
        {
            DateTime date = DateTime.Now;

            System.Windows.Forms.FolderBrowserDialog WorkFolderSlct = new System.Windows.Forms.FolderBrowserDialog();

            if (WorkFolderSlct.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (WorkFolderSlct.SelectedPath != string.Empty)
                {
                    AppSt.Default.save_work_folder = WorkFolderSlct.SelectedPath;
                    AppSt.Default.Save();
                }
            }

            AlreadyPathBox.Text = AppSt.Default.save_work_folder;
        }
Beispiel #45
0
 private void selSaveDir2_Click_1(object sender, RoutedEventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
     fbd.Description         = "请选择图片存储的文件夹";
     fbd.ShowNewFolderButton = true;
     //fbd.RootFolder = Environment.SpecialFolder.Personal;
     System.Windows.Forms.DialogResult result = fbd.ShowDialog();
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         string folderName = fbd.SelectedPath;
         if (folderName != "")
         {
             saveDir2       = folderName;
             saveDirT2.Text = saveDir2;
         }
     }
 }
        // 更改資料夾路徑 Edit Path
        private void edit_path_Click(object sender, RoutedEventArgs e)
        {
            WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog();
            folderDialog.ShowNewFolderButton = false;
            folderDialog.ShowNewFolderButton = true;
            folderDialog.RootFolder          = Environment.SpecialFolder.Desktop;
            folderDialog.SelectedPath        = GloableObject.lastPath;
            WinForms.DialogResult result = folderDialog.ShowDialog();
            if (result == WinForms.DialogResult.Cancel)
            {
                return;
            }
            String sPath = folderDialog.SelectedPath;

            control_path.Content   = sPath;
            GloableObject.lastPath = sPath;
        }
Beispiel #47
0
 private void btSelectFold_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择Txt所在文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show(this, "文件夹路径不能为空", "提示");
             return;
         }
         textBox1.Text = dialog.SelectedPath;
         Settings.Default.platform_tools = dialog.SelectedPath;
         Settings.Default.Save();
         //a.BeginInvoke(dialog.SelectedPath, asyncCallback, a);
     }
 }
Beispiel #48
0
        private void btnLoadDataFolder(object sender, RoutedEventArgs e)
        {
            var fbd = new System.Windows.Forms.FolderBrowserDialog();

            WinForms.DialogResult dataFolder = fbd.ShowDialog();
            //string tmpFolder = @"C:\Users\curra\Documents\school\prog8020\assignments\data";
            if (Directory.Exists(fbd.SelectedPath))
            {
                vm.LoadData(fbd.SelectedPath);
            }
            else
            {
                Debug.Print("VALUE: ", fbd.SelectedPath);
                MessageBox.Show("Please choose a valid folder!");
            }
            //vm.LoadData(tmpFolder);
        }
Beispiel #49
0
        public static string SelectFolder()
        {
            using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
            {
                dialog.Description = "Selecteer de folder om de database naartoe te kopiëren";
                DialogResult result = dialog.ShowDialog();

                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(dialog.SelectedPath))
                {
                    return(dialog.SelectedPath);
                }
                else
                {
                    return("");
                }
            }
        }
 /// <summary>
 /// 保存热力图
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void uiButton_save_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择保存所在文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             //警告不能为空
             this.ShowErrorDialog("路径不能为空");
             return;
         }
         //保存
         pictureBox1.Image.Save(dialog.SelectedPath + "\\KeyBord_" + DateTime.Now.ToString("MM-dd-HH-mm-ss") + ".jpg");
         System.Diagnostics.Process.Start(dialog.SelectedPath);
     }
 }
Beispiel #51
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     //textBox1.Text = "请选择文件夹";
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description  = "请选择Txt所在文件夹";
     dialog.SelectedPath = textBox1.Text;
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             //textBox1.Text = dialog.SelectedPath;
             //System.Windows.MessageBox.Show(this, "文件夹路径不能为空", "提示");
             return;
         }
         textBox1.Text = dialog.SelectedPath;
     }
 }
Beispiel #52
0
 private void ChooseJBjPathBtn_BtnClick(object sender, EventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择Txt所在文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show("文件夹路径不能为空", "提示");
         }
         else
         {
             JBjPathBox.InputText = dialog.SelectedPath;
             IniFileHelper.WriteValue(Environment.CurrentDirectory + "\\settings.ini", "JBeijing", "JBJCTDllPath", JBjPathBox.InputText);
         }
     }
 }
Beispiel #53
0
 private void ChooseJBjPathBtn_BtnClick(object sender, EventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择Txt所在文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show("文件夹路径不能为空", "提示");
         }
         else
         {
             JBjPathBox.InputText         = dialog.SelectedPath;
             Common.settings.JBJCTDllPath = JBjPathBox.InputText;
         }
     }
 }
Beispiel #54
0
 public void button4_Click(object sender, EventArgs e)
 {
     // This line calls the folder diag
     System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog();
     // This is what will execute if the user selects a folder and hits OK (File if you change to FileBrowserDialog)
     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         // string folder = dlg.SelectedPath;
         // folder = _file;
         textBox4.TextChanged += new EventHandler(textBox4_TextChanged);
         textBox4.Text         = dlg.SelectedPath;
     }
     else
     {
         // This prevents a crash when you close out of the window with nothing
     }
 }
        // <summary>
        // フォルダダイアログボックスを表示
        // </summary>
        private void FolderDialog()
        {
            // ダイアログのインスタンスを生成
            var browser = new System.Windows.Forms.FolderBrowserDialog();

            browser.Description = "フォルダーを選択してください";

            // ダイアログを表示する
            if (browser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.Folder = browser.SelectedPath;

                this.OutputFolder.Text = Folder;

                var i = 0;
            }
        }
Beispiel #56
0
 private void BrowseForGDB()
 {
     if (_executeQuery)
     {
         return;
     }
     using (var dlg = new System.Windows.Forms.FolderBrowserDialog()) {
         dlg.Description         = "Browse for a File Geodatabase Folder (.gdb)";
         dlg.SelectedPath        = GDBPath;
         dlg.ShowNewFolderButton = false;
         System.Windows.Forms.DialogResult result = dlg.ShowDialog();
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             GDBPath = dlg.SelectedPath;
         }
     }
 }
Beispiel #57
0
        private void BrowseButton_Click(object sender, RoutedEventArgs e)
        {
            // 圧縮したいファイルが存在するフォルダを指定するためのダイアログボックスの生成
            var dlg = new Forms.FolderBrowserDialog
            {
                // ダイアログボックスの説明文
                Description = "Zipにしたいファイル・フォルダが入っているフォルダーを選択してくれよな!"
            };

            // ダイアログボックスのOKボタンが押されたら
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // 選択されたフォルダーパスをフォルダパスのテキストボックスに入力
                Settings.Default.SourcePath = DirectoryPath.Text = dlg.SelectedPath;
                Settings.Default.Save();
            }
        }
Beispiel #58
0
 private void button2_Click(object sender, EventArgs e)//.minecraft文件夹位置更改
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择.minecraft文件夹";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show("文件夹路径不能为空", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             return;
         }
         minecraftRoad.Text      = dialog.SelectedPath;// +"\\";
         minecraftRoad.ForeColor = Color.Black;
         UpdateMods.Enabled      = true;
         //do something
     }
 }
Beispiel #59
0
 private void renderEachChunkAsAnImageToolStripMenuItem_Click(object sender, EventArgs e) //Sounds Simple Enough...
 {
     using (System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog())
     {
         dlg.Description = "Select A Folder To Place The Chunks In";
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             for (int i = 0; i < Chunks.MaxChunks; i++)
             {
                 Bitmap b;
                 b = Chunks.ChunkList[i].Render(Tiles);
                 b.Save(dlg.SelectedPath + "\\" + i + ".png");
             }
         }
         dlg.Dispose();
     }
 }
Beispiel #60
0
 /// <summary>
 /// 选择图片存放位置
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_ChooseImage_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
     dialog.Description = "请选择下载图片存放路径";
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (string.IsNullOrEmpty(dialog.SelectedPath))
         {
             MessageBox.Show(this, "文件夹路径不能为空", "提示");
             return;
         }
         else
         {
             txt_ImagePath.Text = dialog.SelectedPath;
         }
     }
 }