@@ -11,16 +11,16 @@ public abstract class AsyncResult : IAsyncResult
11
11
// Fields set at construction which never change while operation is pending
12
12
private readonly AsyncCallback _asyncCallback ;
13
13
14
- private readonly Object _asyncState ;
14
+ private readonly object _asyncState ;
15
15
16
16
// Field set at construction which do change after operation completes
17
- private const Int32 StatePending = 0 ;
17
+ private const int StatePending = 0 ;
18
18
19
- private const Int32 StateCompletedSynchronously = 1 ;
19
+ private const int StateCompletedSynchronously = 1 ;
20
20
21
- private const Int32 StateCompletedAsynchronously = 2 ;
21
+ private const int StateCompletedAsynchronously = 2 ;
22
22
23
- private Int32 _completedState = StatePending ;
23
+ private int _completedState = StatePending ;
24
24
25
25
// Field that may or may not get set depending on usage
26
26
private ManualResetEvent _asyncWaitHandle ;
@@ -32,7 +32,7 @@ public abstract class AsyncResult : IAsyncResult
32
32
/// Gets or sets a value indicating whether EndInvoke has been called on the current AsyncResult.
33
33
/// </summary>
34
34
/// <value>
35
- /// <c>true</c> if EndInvoke has been called on the current AsyncResult; otherwise, <c>false</c>.
35
+ /// <c>true</c> if <see cref=" EndInvoke()"/> has been called on the current <see cref=" AsyncResult"/> ; otherwise, <c>false</c>.
36
36
/// </value>
37
37
public bool EndInvokeCalled { get ; private set ; }
38
38
@@ -41,7 +41,7 @@ public abstract class AsyncResult : IAsyncResult
41
41
/// </summary>
42
42
/// <param name="asyncCallback">The async callback.</param>
43
43
/// <param name="state">The state.</param>
44
- protected AsyncResult ( AsyncCallback asyncCallback , Object state )
44
+ protected AsyncResult ( AsyncCallback asyncCallback , object state )
45
45
{
46
46
_asyncCallback = asyncCallback ;
47
47
_asyncState = state ;
@@ -52,7 +52,7 @@ protected AsyncResult(AsyncCallback asyncCallback, Object state)
52
52
/// </summary>
53
53
/// <param name="exception">The exception.</param>
54
54
/// <param name="completedSynchronously">if set to <c>true</c> [completed synchronously].</param>
55
- public void SetAsCompleted ( Exception exception , Boolean completedSynchronously )
55
+ public void SetAsCompleted ( Exception exception , bool completedSynchronously )
56
56
{
57
57
// Passing null for exception means no error occurred; this is the common case
58
58
_exception = exception ;
@@ -99,21 +99,21 @@ public void EndInvoke()
99
99
/// Gets a user-defined object that qualifies or contains information about an asynchronous operation.
100
100
/// </summary>
101
101
/// <returns>A user-defined object that qualifies or contains information about an asynchronous operation.</returns>
102
- public Object AsyncState { get { return _asyncState ; } }
102
+ public object AsyncState { get { return _asyncState ; } }
103
103
104
104
/// <summary>
105
105
/// Gets a value that indicates whether the asynchronous operation completed synchronously.
106
106
/// </summary>
107
107
/// <returns>true if the asynchronous operation completed synchronously; otherwise, false.</returns>
108
- public Boolean CompletedSynchronously
108
+ public bool CompletedSynchronously
109
109
{
110
110
get { return _completedState == StateCompletedSynchronously ; }
111
111
}
112
112
113
113
/// <summary>
114
- /// Gets a <see cref="T:System.Threading. WaitHandle"/> that is used to wait for an asynchronous operation to complete.
114
+ /// Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.
115
115
/// </summary>
116
- /// <returns>A <see cref="T:System.Threading. WaitHandle"/> that is used to wait for an asynchronous operation to complete.</returns>
116
+ /// <returns>A <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</returns>
117
117
public WaitHandle AsyncWaitHandle
118
118
{
119
119
get
@@ -144,8 +144,9 @@ public WaitHandle AsyncWaitHandle
144
144
/// <summary>
145
145
/// Gets a value that indicates whether the asynchronous operation has completed.
146
146
/// </summary>
147
- /// <returns>true if the operation is complete; otherwise, false.</returns>
148
- public Boolean IsCompleted
147
+ /// <returns>
148
+ /// <c>true</c> if the operation is complete; otherwise, <c>false</c>.</returns>
149
+ public bool IsCompleted
149
150
{
150
151
get { return _completedState != StatePending ; }
151
152
}
@@ -162,11 +163,11 @@ public abstract class AsyncResult<TResult> : AsyncResult
162
163
private TResult _result ;
163
164
164
165
/// <summary>
165
- /// Initializes a new instance of the <see cref="AsyncResult< TResult> "/> class.
166
+ /// Initializes a new instance of the <see cref="AsyncResult{ TResult} "/> class.
166
167
/// </summary>
167
168
/// <param name="asyncCallback">The async callback.</param>
168
169
/// <param name="state">The state.</param>
169
- protected AsyncResult ( AsyncCallback asyncCallback , Object state )
170
+ protected AsyncResult ( AsyncCallback asyncCallback , object state )
170
171
: base ( asyncCallback , state )
171
172
{
172
173
}
@@ -176,19 +177,21 @@ protected AsyncResult(AsyncCallback asyncCallback, Object state)
176
177
/// </summary>
177
178
/// <param name="result">The result.</param>
178
179
/// <param name="completedSynchronously">if set to <c>true</c> [completed synchronously].</param>
179
- public void SetAsCompleted ( TResult result , Boolean completedSynchronously )
180
+ public void SetAsCompleted ( TResult result , bool completedSynchronously )
180
181
{
181
182
// Save the asynchronous operation's result
182
183
_result = result ;
183
184
184
185
// Tell the base class that the operation completed successfully (no exception)
185
- base . SetAsCompleted ( null , completedSynchronously ) ;
186
+ SetAsCompleted ( null , completedSynchronously ) ;
186
187
}
187
188
188
189
/// <summary>
189
190
/// Waits until the asynchronous operation completes, and then returns the value generated by the asynchronous operation.
190
191
/// </summary>
191
- /// <returns>Invocation result</returns>
192
+ /// <returns>
193
+ /// The invocation result.
194
+ /// </returns>
192
195
public new TResult EndInvoke ( )
193
196
{
194
197
base . EndInvoke ( ) ; // Wait until operation has completed
0 commit comments