private void Move_directory_ProgressUpdatedEvent(object sender, FileProgressUpdatedArgs e) { Console.WriteLine($"{e.BytesProcessed}-{e.TotalBytes}"); lb_move_directory.Dispatcher.Invoke(() => { lb_move_directory.Content = $"Copy file: {System.IO.Path.GetFileName(e.OriginFile)} [{UltimateFile.ToSize(e.BytesProcessed)}/{UltimateFile.ToSize(e.TotalBytes)}]"; }); pb_move_directory.Dispatcher.Invoke(() => { pb_move_directory.Value = (e.BytesProcessed * 100) / e.TotalBytes; }); }
private async void Bt_move_file_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { FileManager fm = new FileManager(); fm.ProgressUpdatedEvent += Move_ProgressUpdatedEvent;; bool x = await fm.MoveFileAsync( tb_file_to_copy.Text, UltimateFile.ChangeDirectory(dialog.SelectedPath, tb_file_to_copy.Text) ); } }
private void bt_change_directory_Click(object sender, RoutedEventArgs e) { tb_output.Text = $"Change directory of file:\ninput {tb_file_selected.Text}\noutput {UltimateFile.ChangeDirectory(tb_new_directory.Text, tb_file_selected.Text)}"; }