示例#1
0
        private void CallStateChangedHandler(object sender, ToxAvEventArgs.CallStateEventArgs e)
        {
            if ((e.FriendNumber == _friendInCall) &&
                (e.State.HasFlag(ToxAvFriendCallState.Finished) || e.State.HasFlag(ToxAvFriendCallState.Error)))
            {
                _friendInCall = -1;
            }

            CallStateChanged?.Invoke(this, e);
        }
        private void HandleClick(bool value)
        {
            this.isCallAccepted = value;
            this.Parent.Controls[this.Name].Hide();

            if (this.CallStateChanged != null)
            {
                CallStateChanged.Invoke(value, this.caller);
            }
        }
示例#3
0
 public void OnCallState(CallStateChanged e)
 {
     lock (_lock)
         if (_activeCalls.ContainsKey(e.Id) && _activeCalls[e.Id] != null)
         {
             CallStateChangedEventArgs ea;
             if (_eaCache.TryGetValue(new ValueWrapper <int>(e.Id), out ea))
             {
                 ea.DestinationUri = _activeCalls[e.Id].DestinationUri;
                 ea.Duration       = _activeCalls[e.Id].TotalDuration;
             }
             _activeCalls[e.Id].HandleSignallingStateChanged();
         }
 }
示例#4
0
 internal static void RaiseCallStateChanged() => CallStateChanged?.Invoke(null, null);
示例#5
0
 protected virtual void OnCallStateChanged(CallStateEventArgs e)
 {
     CallStateChanged?.Invoke(this, e);
 }
示例#6
0
 public void OnCallState(CallStateChanged e)
 {
     lock (_lock)
         if (_activeCalls.ContainsKey(e.Id) && _activeCalls[e.Id] != null)
         {
             CallStateChangedEventArgs ea;
             if (_eaCache.TryGetValue(new ValueWrapper<int>(e.Id), out ea))
             {
                 ea.DestinationUri = _activeCalls[e.Id].DestinationUri;
                 ea.Duration = _activeCalls[e.Id].TotalDuration;
             }
             _activeCalls[e.Id].HandleSignallingStateChanged();
         }
 }