예제 #1
0
        public static string StartForResult()
        {
            SelectFileForm form = new SelectFileForm();

            form.ShowDialog();
            return(isSelectedFile?(string)form.listFiles.SelectedItem:"");
        }
예제 #2
0
        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;
        }