public IAsyncResult BeginAddBlockedSubscription(AccountId userId, AsyncCallback callback) { AssertLoggedIn(); AsyncNoResult ar = new AsyncNoResult(callback); if (_blockedSubscriptions.Contains((userId))) { ar.SetCompletedSynchronously(); return(ar); } var request = new vx_req_account_create_block_rule_t { account_handle = _accountHandle, block_mask = userId.ToString(), presence_only = 0 }; VxClient.Instance.BeginIssueRequest(request, result => { try { VxClient.Instance.EndIssueRequest(result); _blockedSubscriptions.Add(userId); 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_account_create_block_rule_t obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }