internal static void StartChat(String remoteUri) { SessionWindow sessionWindow = null; MessagingWindow messagingWindow = null; lock (SessionWindow.Windows) { sessionWindow = SessionWindow.Windows.FirstOrDefault(w => w.CanStartChat(remoteUri)); } if (sessionWindow == null) { lock (MessagingWindow.Windows) { messagingWindow = MessagingWindow.Windows.FirstOrDefault(w => w.CanStartChat(remoteUri)); } if (messagingWindow == null) { messagingWindow = new MessagingWindow(remoteUri); } messagingWindow.StartChat(remoteUri); } else { sessionWindow.StartChat(remoteUri); } }
internal static void SendFile(String remoteUri, String filePath) { SessionWindow sessionWindow = null; MessagingWindow messagingWindow = null; lock (SessionWindow.Windows) { sessionWindow = SessionWindow.Windows.FirstOrDefault(w => w.CanSendFile(remoteUri)); } if (sessionWindow == null) { lock (MessagingWindow.Windows) { messagingWindow = MessagingWindow.Windows.FirstOrDefault(w => w.CanSendFile(remoteUri)); } if (messagingWindow == null) { messagingWindow = new MessagingWindow(remoteUri); } messagingWindow.SendFile(remoteUri, filePath); } else { sessionWindow.SendFile(remoteUri, filePath); } }
internal static void ReceiveCall(MyInviteSession session) { SessionWindow window = null; lock (SessionWindow.Windows) { window = SessionWindow.Windows.FirstOrDefault(w => w.CanReceiveCall(session)); } if (window == null) { window = new SessionWindow(session.RemotePartyUri); } window.ReceiveCall(session); }
internal static void MakeVideoCall(String remoteUri) { SessionWindow window = null; lock (SessionWindow.Windows) { window = SessionWindow.Windows.FirstOrDefault(w => w.CanMakeAudioVideoCall(remoteUri)); } if (window == null) { window = new SessionWindow(remoteUri); } window.MakeVideoCall(remoteUri); }
internal static void MakeAudioCall(String remoteUri) { SessionWindow window = null; foreach (var item in SessionWindow.Windows) { item.Close(); } //lock (SessionWindow.Windows) //{ // window = SessionWindow.Windows.FirstOrDefault(w => w.CanMakeAudioVideoCall(remoteUri)); //} if (window == null) { window = new SessionWindow(remoteUri); //将会话窗口给公用变量 Common.CurrSession = window; } window.MakeAudioCall(remoteUri); }