private void ShowFileTransferProgressToast(FileTransfer.FileTransferProgressEventArgs e) { if (e.State == FileTransferState.Finished) { Toaster.ShowFileReceiveFinishedNotification(e.TotalFiles, e.SenderName, e.Guid); } else { double percent = ((double)e.CurrentPart) / ((double)e.Total); Toaster.ShowFileReceiveProgressNotification(e.SenderName, e.Total == 0 ? -1.0 : percent, e.Guid); } }
private async void FileReceiver_FileTransferProgress(FileTransfer2ProgressEventArgs e) { if (e.State == FileTransferState.Finished) { Toaster.ShowFileReceiveFinishedNotification(e.TotalFiles, e.SenderName, e.Guid); } else if (e.State == FileTransferState.Error) { Toaster.ShowFileReceiveFailedNotification(e.Guid, e.Exception); } await NotificationHandler.HandleAsync(e); }
private void ShowFileTransferProgressToast(FileTransfer.FileTransfer2ProgressEventArgs e) { if (e.State == FileTransferState.Finished) { Toaster.ShowFileReceiveFinishedNotification(e.TotalFiles, e.SenderName, e.Guid); } else if (e.State == FileTransferState.Error) { Toaster.ShowFileReceiveFailedNotification(e.Guid, e.Exception); } else { Toaster.ShowFileReceiveProgressNotification(e.SenderName, e.Progress, e.TotalTransferredBytes, e.Guid); } }