Exemplo n.º 1
0
        public bool SendControl(int friendNumber, ToxAvCallControl control)
        {
            if (friendNumber == _friendInCall && control == ToxAvCallControl.Cancel)
            {
                _friendInCall = -1;
            }

            ToxAvErrorCallControl error;
            var retVal = _toxAv.SendControl(friendNumber, control, out error);

            ToxErrorViewModel.Instance.RelayError(error);
            return(retVal);
        }
Exemplo n.º 2
0
        public void TestToxAvSendControl()
        {
            var  control      = ToxAvCallControl.Pause;
            var  error        = ToxAvErrorCallControl.Ok;
            bool testFinished = false;

            _toxAv2.OnCallStateChanged += (sender, e) =>
            {
                if (!e.State.HasFlag(ToxAvFriendCallState.Paused))
                {
                    Assert.Fail("Tried to pause a call but the call state didn't change correctly, call state: {0}", e.State);
                }

                testFinished = true;
            };

            bool result = _toxAv1.SendControl(0, control, out error);

            if (!result || error != ToxAvErrorCallControl.Ok)
            {
                Assert.Fail("Could not send call control, error: {0}, result: {1}", error, result);
            }

            while (!testFinished)
            {
                DoIterate();
            }
        }