Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
 private void ShowFileTransferProgressToast(FileTransfer.FileTransferProgressEventArgs e)
 {
     if (e.State == FileTransferState.Finished)
     {
         Toaster.ShowFileReceiveFinishedNotification(e.TotalFiles, e.SenderName, e.Guid);
     }
     else if (e.State == FileTransferState.Error)
     {
         Toaster.ShowFileReceiveFailedNotification(e.Guid);
     }
     else
     {
         double percent = ((double)e.CurrentPart) / ((double)e.Total);
         Toaster.ShowFileReceiveProgressNotification(e.SenderName, e.Total == 0 ? -1.0 : percent, e.TotalBytesTransferred, e.Guid);
     }
 }