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