Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }