Esempio n. 1
0
 /// <summary>
 /// Add a CallConnection to the callConnections list.
 /// </summary>
 /// <param name="callConnection">An instance of the CallConnection class</param>
 public static void AddCallConnection(CallConnection callConnection)
 {
     // Make sure the CallConnection is not present in the callConnections already.
     if (!callConnections.Contains(callConnection))
     {
         callConnections.Add(callConnection);
         // Update MainWindow.
         mainWindow.SetNumberOfConnectedCalls(callConnections.Count());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Remove a CallConnection instance from the callConnections list and remove the connection from the database.
 /// </summary>
 /// <param name="callConnection">A CallConnection instance.</param>
 public static void RemoveCallConnection(CallConnection callConnection)
 {
     if (callConnections.Contains(callConnection))
     {
         var dbManager = new DatabaseManager();
         dbManager.RemoveVideoCallConnection(callConnection.GetClient1().clientID, callConnection.GetClient2().clientID);
         dbManager.Close();
         callConnections.Remove(callConnection);
         mainWindow.SetNumberOfConnectedCalls(callConnections.Count());
     }
 }