コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
 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}");
         }
     }
 }
コード例 #3
0
 public System.Threading.Tasks.Task <MyPhotosClientWCF.File> AddFileAsync(MyPhotosClientWCF.File toBeAdded)
 {
     return(base.Channel.AddFileAsync(toBeAdded));
 }
コード例 #4
0
 public MyPhotosClientWCF.File AddFile(MyPhotosClientWCF.File toBeAdded)
 {
     return(base.Channel.AddFile(toBeAdded));
 }