Ejemplo n.º 1
0
 private void InCallForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (closingApp == true)
     {
         return;
     }
     closingApp         = true;
     Program.actualCall = null;
     Program.isInCall   = false;
     Program.spGlobal   = null;
     if (this.callId == null)
     {
         return;
     }
     packetsCounterTimer.Stop();
     tokenSource.Cancel();
     sp.stop();
     CallProcessing.SendMessages(BitConverter.GetBytes(callId.id));
     CallProcessing.SendMessages(BitConverter.GetBytes(callId.id));
     CallProcessing.SendMessages(BitConverter.GetBytes(callId.id));
     CallProcessing.Stop();
     LoggedInService.declineCall(this.callId);
     if (updateFriendViewOnClosing != null)
     {
         updateFriendViewOnClosing();
     }
 }
Ejemplo n.º 2
0
 private void declineCall_button_Click(object sender, EventArgs e)
 {
     if (this.call == null)
     {
         return;
     }
     LoggedInService.declineCall(new Id(this.call.callId));
     this.call = null;
     this.Close();
 }
Ejemplo n.º 3
0
 private void IncomingCallForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.call == null)
     {
         return;
     }
     if (!acceptedCall)
     {
         LoggedInService.declineCall(new Id(this.call.callId));
     }
     this.call = null;
 }
Ejemplo n.º 4
0
 public void callUserReplyFromUser(Boolean reply)
 {
     if (callingStatusLabel.InvokeRequired)
     {
         callingStatusLabel.Invoke(new MethodInvoker(() => { callUserReplyFromUser(reply); }));
     }
     else
     {
         callingStatusLabel.Visible = true;
         if (reply == true)
         {
             callUser.Enabled             = false;
             callingStatusLabel.Text      = "";
             callingStatusLabel.ForeColor = Color.Green;
             if (lastCallId != null && lastCallUsername != null)
             {
                 Call c = new Call(lastCallId.id, new List <string> {
                     lastCallUsername.username
                 });
                 NoneCallback ncb = updateFriendViewOnCallClosing;
                 InCallForm   icf = new InCallForm(c, ncb);
                 icf.Show();
                 updateCallStatus(new Friend(lastCallUsername, 1));
             }
         }
         else
         {
             callUser.Enabled             = true;
             callingStatusLabel.Text      = "Odrzucono połączenie!";
             callingStatusLabel.ForeColor = Color.Red;
             if (!Program.isInCall)
             {
                 LoggedInService.declineCall(lastCallId);
             }
         }
     }
 }