private void FileList_SelectedIndexChanged(object sender, EventArgs e) { if (FileList.SelectedItems.Count > 0) { workingFile = fileList[FileList.SelectedItems[0].Index]; previewImage = new Bitmap(workingFile.Path); if (previewImage != null) { PicturePreview.Image = previewImage; } } }
private void AddNewFileButton_Click(object sender, EventArgs e) { openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { try { var sr = new StreamReader(openFileDialog.FileName); string fileData = sr.ReadToEnd(); MyPhotosClientWCF.File workingFile = client.CreateNewFile(openFileDialog.FileName, openFileDialog.SafeFileName); AddNewFileForm newFileForm = new AddNewFileForm(workingFile, this, client); newFileForm.Show(); } catch (SecurityException ex) { MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" + $"Details:\n\n{ex.StackTrace}"); } } }
public System.Threading.Tasks.Task <MyPhotosClientWCF.File> AddFileAsync(MyPhotosClientWCF.File toBeAdded) { return(base.Channel.AddFileAsync(toBeAdded)); }
public MyPhotosClientWCF.File AddFile(MyPhotosClientWCF.File toBeAdded) { return(base.Channel.AddFile(toBeAdded)); }