/// <summary> /// Initiates an operation to add av call to the conversation by providing a callback phone number. /// </summary> /// <param name="callback">Callback method.</param> /// <param name="state">User state.</param> /// <returns>Async result reference.</returns> public IAsyncResult BeginAddClickToCall(string callbackNumber, AsyncCallback callback, object state) { if (this.State != ConversationModelState.Established) { throw new InvalidOperationException(ExceptionResource.InvalidState); } if (String.IsNullOrEmpty(callbackNumber)) { throw new ArgumentException(ExceptionResource.InvalidCallbackNumber); } AddClickToCallAsyncResult asyncResult = new AddClickToCallAsyncResult(this, callbackNumber, callback, state); asyncResult.Process(); return(asyncResult); }
/// <summary> /// Waits for corresponding begin operation to complete. /// </summary> /// <param name="asyncResult">Async result from the corresponding begin method.</param> public void EndAddClickToCall(IAsyncResult asyncResult) { if (asyncResult == null) { throw new ArgumentException(ExceptionResource.InvalidAsyncResult); } else { AddClickToCallAsyncResult addClickToCallAsyncResult = asyncResult as AddClickToCallAsyncResult; if (addClickToCallAsyncResult == null) { throw new ArgumentException(ExceptionResource.InvalidAsyncResult); } else { addClickToCallAsyncResult.EndInvoke(); } } }