/// <summary> /// Browse button was clicked by user. /// </summary> private void OnBrowseButtonClicked(object sender, OpenDialogArgs e) { try { ExplorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(Input, "FullFileName", e.FileNames[0])); } catch (Exception err) { ExplorerPresenter.MainPresenter.ShowMessage(err.Message, DataStore.ErrorLevel.Error); } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null && OpenFileDialog.ShowDialog() == DialogResult.OK) { OpenDialogArgs args = new OpenDialogArgs(); args.FileNames = OpenFileDialog.FileNames; BrowseButtonClicked.Invoke(this, args); } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null) { string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "Sqlite (*.db) | *.db"); if (!String.IsNullOrEmpty(fileName)) { OpenDialogArgs args = new OpenDialogArgs(); args.FileName = fileName; BrowseButtonClicked.Invoke(this, args); } } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null) { string fileName = AskUserForFileName("Select a file to open", "", FileChooserAction.Open, FileName); if (!String.IsNullOrEmpty(fileName)) { OpenDialogArgs args = new OpenDialogArgs(); args.FileName = fileName; BrowseButtonClicked.Invoke(this, args); } } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null) { string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "ASCII Text Files (*.*) | *.*"); if (!String.IsNullOrEmpty(fileName)) { OpenDialogArgs args = new OpenDialogArgs(); args.FileName = fileName; //Dialogs seem to return the full file path not just the filename. BrowseButtonClicked.Invoke(this, args); } } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null) { FileChooserDialog fileChooser = new FileChooserDialog("Select a file to open", null, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept); FileFilter allFilter = new FileFilter(); allFilter.AddPattern("*"); allFilter.Name = "All files"; fileChooser.AddFilter(allFilter); if (fileChooser.Run() == (int)ResponseType.Accept) { OpenDialogArgs args = new OpenDialogArgs(); args.FileNames = fileChooser.Filenames; BrowseButtonClicked.Invoke(this, args); } fileChooser.Destroy(); } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { try { if (BrowseButtonClicked != null) { string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "All Files (*.*) | *.*", FileName); if (!string.IsNullOrEmpty(fileName)) { OpenDialogArgs args = new OpenDialogArgs(); args.FileName = fileName; BrowseButtonClicked.Invoke(this, args); } } } catch (Exception err) { ShowError(err); } }
/// <summary> /// Browse button was clicked - send event to presenter. /// </summary> private void OnBrowseButtonClick(object sender, EventArgs e) { if (BrowseButtonClicked != null ) { FileChooserDialog fileChooser = new FileChooserDialog("Select a file to open", null, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept); FileFilter allFilter = new FileFilter(); allFilter.AddPattern("*"); allFilter.Name = "All files"; fileChooser.AddFilter(allFilter); if (fileChooser.Run() == (int)ResponseType.Accept) { OpenDialogArgs args = new OpenDialogArgs(); args.FileNames = fileChooser.Filenames; BrowseButtonClicked.Invoke(this, args); } fileChooser.Destroy(); } }