12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- //------------------------------------------------------------------------------
- // <copyright file="ReceiveCompletedEventArgs.cs" company="Microsoft">
- // Copyright (c) Microsoft Corporation. All rights reserved.
- // </copyright>
- //------------------------------------------------------------------------------
- using System;
- namespace Experimental.System.Messaging
- {
- /// <include file='doc\ReceiveCompletedEventArgs.uex' path='docs/doc[@for="ReceiveCompletedEventArgs"]/*' />
- /// <devdoc>
- /// <para>Provides data for the <see cref='System.Messaging.MessageQueue.ReceiveCompleted'/>
- /// event.</para>
- /// </devdoc>
- public class ReceiveCompletedEventArgs : EventArgs
- {
- private IAsyncResult result;
- private Message message;
- private MessageQueue sender;
- /// <include file='doc\ReceiveCompletedEventArgs.uex' path='docs/doc[@for="ReceiveCompletedEventArgs.ReceiveCompletedEventArgs"]/*' />
- /// <internalonly/>
- internal ReceiveCompletedEventArgs(MessageQueue sender, IAsyncResult result)
- {
- this.result = result;
- this.sender = sender;
- }
- /// <include file='doc\ReceiveCompletedEventArgs.uex' path='docs/doc[@for="ReceiveCompletedEventArgs.AsyncResult"]/*' />
- /// <devdoc>
- /// <para>Contains the result of the asynchronous
- /// operation requested.</para>
- /// </devdoc>
- public IAsyncResult AsyncResult
- {
- get
- {
- return this.result;
- }
- set
- {
- this.result = value;
- }
- }
- /// <include file='doc\ReceiveCompletedEventArgs.uex' path='docs/doc[@for="ReceiveCompletedEventArgs.Message"]/*' />
- /// <devdoc>
- /// <para>The end result of the posted asynchronous receive
- /// operation.</para>
- /// </devdoc>
- public Message Message
- {
- get
- {
- if (this.message == null)
- {
- try
- {
- this.message = this.sender.EndReceive(result);
- }
- catch
- {
- throw;
- }
- }
- return this.message;
- }
- }
- }
- }
|