void browseButton_MouseButtonClick(Widget source, EventArgs e) { DirDialog dirDialog = new DirDialog(MainWindow.Instance, "Choose the path to load files from.", locationTextBox.Caption); dirDialog.showModal((result, path) => { if (result == NativeDialogResult.OK) { locationTextBox.Caption = path; listFiles(); } }); }
void outputBrowse_MouseButtonClick(Widget source, EventArgs e) { try { String startingFolder = outputFolder.OnlyText; if (!Directory.Exists(startingFolder)) { startingFolder = MedicalConfig.ImageOutputFolder; ensureOutputFolderExists(startingFolder); } DirDialog dirDialog = new DirDialog(MainWindow.Instance, "Select a render output folder", startingFolder); dirDialog.showModal((result, path) => { if (result == NativeDialogResult.OK) { outputFolder.OnlyText = path; } }); } catch (Exception ex) { MessageBox.show("Could not open folder browser.\nReason: " + ex.Message, "Error", MessageBoxStyle.Ok | MessageBoxStyle.IconError); } }
private void folderResults(NativeDialogResult result, String path, SendResult <String> resultCallback, DirDialog dlg) { if (result == NativeDialogResult.OK) { String errorPrompt = null; if (!resultCallback(path, ref errorPrompt)) { dlg.showModal((mResult, mPath) => { folderResults(mResult, mPath, resultCallback, dlg); }); } } }