public static string StartForResult() { SelectFileForm form = new SelectFileForm(); form.ShowDialog(); return(isSelectedFile?(string)form.listFiles.SelectedItem:""); }
private void LoadFileFromDatabase(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; var result = _selectFileForm.ShowDialog(); if (result != DialogResult.OK) { Cursor = Cursors.Default; return; } var fileName = _selectFileForm.SelectedFileName; var task = _fileService.LoadFileFromDatabaseAsync(fileName); Text = fileName; var file = task.Result; MainText.Text = Encoding.UTF8.GetString(file.Content); Cursor = Cursors.Default; }