Example #1
0
 public void StopAllTasks()
 {
     foreach (object o in tasks)
     {
         SenderTask task = o as SenderTask;
         task.Stop();
     }
 }
Example #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);
        }
Example #3
0
 private void task_SuccessfullyCompleted(SenderTask task)
 {
     tasks.Dispatcher.Invoke(() => FileSent(task));
     usedPorts.Remove(task.Port);
 }
Example #4
0
 private void task_Delete(SenderTask task)
 {
     usedPorts.Remove(task.Port);
     tasks.Dispatcher.Invoke(() => tasks.Remove(task));
 }
Example #5
0
 private void task_Completed(SenderTask task)
 {
     usedPorts.Remove(task.Port);
 }
Example #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);
 }