public IAsyncResult BeginAsyncWhisperFromApp(string from, long toCID, string message, AsyncCallback callback, object asyncState) { WhisperAsyncResult whisperAsyncResult = new WhisperAsyncResult(callback, asyncState); if (this.WhisperedAsync != null) { WhisperAsyncEventArg e = new WhisperAsyncEventArg { From = from, ToCID = toCID, Message = message, AsyncResult = whisperAsyncResult, Callback = new WhisperCompleted(this.WhisperCallback) }; this.WhisperedAsync(this, e); return(whisperAsyncResult); } IAsyncResult result; try { result = whisperAsyncResult; } finally { whisperAsyncResult.Complete(); } return(result); }
private void WhisperFromAppAsync(RelayClient client, WhisperAsyncEventArg arg) { arg.Callback(this.WhisperToGameClient(arg.From, arg.ToCID, arg.Message), arg.AsyncResult); }