示例#1
0
 public void StopAllTasks()
 {
     foreach (object o in tasks)
     {
         SenderTask task = o as SenderTask;
         task.Stop();
     }
 }
示例#2
0
        private SenderTask generateTask(Contact contact, string file)
        {
            SenderTask task = new SenderTask(file, getFreePortWith, contact, Name);

            task.Delete                += task_Delete;
            task.Completed             += task_Completed;
            task.SuccessfullyCompleted += task_SuccessfullyCompleted;
            tasks.Dispatcher.Invoke(() => tasks.Add(task));
            return(task);
        }
示例#3
0
 private void task_SuccessfullyCompleted(SenderTask task)
 {
     tasks.Dispatcher.Invoke(() => FileSent(task));
     usedPorts.Remove(task.Port);
 }
示例#4
0
 private void task_Delete(SenderTask task)
 {
     usedPorts.Remove(task.Port);
     tasks.Dispatcher.Invoke(() => tasks.Remove(task));
 }
示例#5
0
 private void task_Completed(SenderTask task)
 {
     usedPorts.Remove(task.Port);
 }
示例#6
0
 /// <summary>
 /// File sent handler
 /// </summary>
 /// <param name="task">Sent file task</param>
 private void sender_FileSent(SenderTask task)
 {
     // Show balloon tip
     trayIcon.ShowBalloonTip(3000, "Octo Sender", task.SourceFile.Name + " sent to " + task.TargetContact.ContactName, ToolTipIcon.Info);
 }