Beispiel #1
0
        public IAsyncResult SetIsMuteForAll(string accountHandle, bool setMuted, string accessToken, AsyncCallback callback)
        {
            if (string.IsNullOrEmpty(accessToken))
            {
                throw new ArgumentNullException(nameof(accessToken));
            }

            AsyncNoResult ar      = new AsyncNoResult(callback);
            var           request = new vx_req_channel_mute_user_t
            {
                account_handle  = accountHandle,
                channel_uri     = _parent.Key.ToString(),
                participant_uri = Account.ToString(),
                set_muted       = setMuted ? 1 : 0,
                access_token    = accessToken
            };

            VxClient.Instance.BeginIssueRequest(request, result =>
            {
                try
                {
                    VxClient.Instance.EndIssueRequest(result);
                    ar.SetComplete();
                }
                catch (Exception e)
                {
                    VivoxDebug.Instance.VxExceptionMessage($"{request.GetType().Name} failed: {e}");
                    ar.SetComplete(e);
                    if (VivoxDebug.Instance.throwInternalExcepetions)
                    {
                        throw;
                    }
                    return;
                }
            });
            return(ar);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(vx_req_channel_mute_user_t obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }