Example #1
0
        private void _videoTalkService_ReceivedIncomingCallEvent(object sender, ReceivedIncommingCallEventArgs e)
        {
            lock (m_SyncRoot)
            {
                this.ClientDevice = e.ClientDevice;
                this.CallState    = CallState.ReceivedIncomingCall;
            }

            _RingTimeoutAction.Start(RingTimeout);
            //StartRingTimeoutTimer(RingTimeout);
            Application.Current.Dispatcher.Invoke(() => Messenger.Default.Send(new ReceivedIncomingCallEvent()));
        }
Example #2
0
        public void TestTimeoutStartWithArg()
        {
            ManualResetEvent h = new ManualResetEvent(false);

            TimeoutAction.Start(TimeSpan.FromMilliseconds(1), delegate(ManualResetEvent mre) { mre.Set(); }, h);
            Assert.IsTrue(h.WaitOne(1000, false));
        }
Example #3
0
        public void TestTimeoutStartWithErrorHandler()
        {
            ManualResetEvent h = new ManualResetEvent(false);

            TimeoutAction.Start(TimeSpan.FromMilliseconds(1), delegate { throw new ApplicationException(); }, delegate(Exception err) { h.Set(); });
            Assert.IsTrue(h.WaitOne(1000, false));
        }
Example #4
0
 private void _videoTalkService_AcceptedIncomingCallEvent(object sender, EventArgs e)
 {
     lock (m_SyncRoot)
     {
         this.CallState = CallState.AcceptedIncomingCall;
     }
     _TalkTimeoutAction.Start(TalkTimeout);
     Application.Current.Dispatcher.Invoke(() => Messenger.Default.Send(new AcceptedIncomingCallEvent()));
 }
Example #5
0
        public void TestTimeoutStartWithArgAndErrorHandler()
        {
            ManualResetEvent h1 = new ManualResetEvent(false);
            ManualResetEvent h2 = new ManualResetEvent(false);

            TimeoutAction.Start(TimeSpan.FromMilliseconds(1), delegate(ManualResetEvent mre) { mre.Set(); throw new ApplicationException(); }, h1, delegate(Exception err) { h2.Set(); });
            Assert.IsTrue(h1.WaitOne(1000, false));
            Assert.IsTrue(h2.WaitOne(1000, false));
        }