1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="TaskCompletionSource<TResult>" FullName="System.Threading.Tasks.TaskCompletionSource<TResult>">
<TypeSignature Language="C#" Value="public class TaskCompletionSource<TResult>" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TaskCompletionSource`1<TResult> extends System.Object" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="TResult" />
</TypeParameters>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<typeparam name="TResult">To be added.</typeparam>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>In many scenarios, it is useful to enable a <see cref="T:System.Threading.Tasks.Task`1" /> to represent an external asynchronous operation. <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" /> is provided for this purpose. It enables the creation of a task that can be handed out to consumers, and those consumers can use the members of the task as they would any other. However, unlike most tasks, the state of a task created by a TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSource. This enables the completion of the external asynchronous operation to be propagated to the underlying Task. The separation also ensures that consumers are not able to transition the state without access to the corresponding TaskCompletionSource. For more information, see the entry <see cref="http://blogs.msdn.com/b/pfxteam/archive/2009/06/02/9685804.aspx">The Nature of TaskCompletionSource<TResult></see> in the Parallel Programming with .NET blog.</para>
<para>The <see cref="http://go.microsoft.com/fwlink/?LinkID=165717">Parallel Extensions samples</see> also contain examples of how to use <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Represents the producer side of a <see cref="T:System.Threading.Tasks.Task`1" /> unbound to a delegate, providing access to the consumer side through the <see cref="P:System.Threading.Tasks.TaskCompletionSource`1.Task" /> property.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" />.</para>
</summary>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource (object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(object state) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" /> with the specified state.</para>
</summary>
<param name="state">
<attribution license="cc4" from="Microsoft" modified="false" />The state to use as the underlying <see cref="T:System.Threading.Tasks.Task`1" />'s AsyncState.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource (System.Threading.Tasks.TaskCreationOptions creationOptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Threading.Tasks.TaskCreationOptions creationOptions) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="creationOptions" Type="System.Threading.Tasks.TaskCreationOptions" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Threading.Tasks.Task`1" /> created by this instance and accessible through its <see cref="P:System.Threading.Tasks.TaskCompletionSource`1.Task" /> property will be instantiated using the specified <paramref name="creationOptions" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" /> with the specified options.</para>
</summary>
<param name="creationOptions">
<attribution license="cc4" from="Microsoft" modified="false" />The options to use when creating the underlying <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TaskCompletionSource (object state, System.Threading.Tasks.TaskCreationOptions creationOptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(object state, valuetype System.Threading.Tasks.TaskCreationOptions creationOptions) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="state" Type="System.Object" />
<Parameter Name="creationOptions" Type="System.Threading.Tasks.TaskCreationOptions" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" /> with the specified state and options.</para>
</summary>
<param name="state">
<attribution license="cc4" from="Microsoft" modified="false" />The state to use as the underlying <see cref="T:System.Threading.Tasks.Task`1" />'s AsyncState.</param>
<param name="creationOptions">
<attribution license="cc4" from="Microsoft" modified="false" />The options to use when creating the underlying <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName="SetCanceled">
<MemberSignature Language="C#" Value="public void SetCanceled ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetCanceled() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Transitions the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state.</para>
</summary>
</Docs>
</Member>
<Member MemberName="SetException">
<MemberSignature Language="C#" Value="public void SetException (System.Collections.Generic.IEnumerable<Exception> exceptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Collections.Generic.IEnumerable`1<class System.Exception> exceptions) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exceptions" Type="System.Collections.Generic.IEnumerable<System.Exception>" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Transitions the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</para>
</summary>
<param name="exceptions">
<attribution license="cc4" from="Microsoft" modified="false" />The collection of exceptions to bind to this <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName="SetException">
<MemberSignature Language="C#" Value="public void SetException (Exception exception);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetException(class System.Exception exception) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exception" Type="System.Exception" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Transitions the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</para>
</summary>
<param name="exception">
<attribution license="cc4" from="Microsoft" modified="false" />The exception to bind to this <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName="SetResult">
<MemberSignature Language="C#" Value="public void SetResult (TResult result);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetResult(!TResult result) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="result" Type="TResult" />
</Parameters>
<Docs>
<param name="result">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Task">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.Task<TResult> Task { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Threading.Tasks.Task`1<!TResult> Task" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<TResult></ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This property enables a consumer to access the <see cref="T:System.Threading.Tasks.Task`1" /> that is controlled by this instance. When you create a <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" /> object, the <see cref="P:System.Threading.Tasks.Task.Status" /> property of this <see cref="T:System.Threading.Tasks.Task`1" /> object returns <see cref="F:System.Threading.Tasks.TaskStatus.WaitingForActivation" /></para>
<para> The <see cref="M:System.Threading.Tasks.TaskCompletionSource`1.SetResult(`0)" />, <see cref="M:System.Threading.Tasks.TaskCompletionSource`1.SetException(System.Exception)" />, <see cref="M:System.Threading.Tasks.TaskCompletionSource`1.SetException(System.Collections.Generic.IEnumerable{System.Exception})" />, and <see cref="M:System.Threading.Tasks.TaskCompletionSource`1.SetCanceled" /> methods (and their "Try" variants) on this instance all result in the relevant state transitions on this underlying Task.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the <see cref="T:System.Threading.Tasks.Task`1" /> created by this <see cref="T:System.Threading.Tasks.TaskCompletionSource`1" />.</para>
</summary>
</Docs>
</Member>
<Member MemberName="TrySetCanceled">
<MemberSignature Language="C#" Value="public bool TrySetCanceled ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetCanceled() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This operation will return false if the <see cref="T:System.Threading.Tasks.Task`1" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />. </para>
<para>This method also returns false if the underlying <see cref="T:System.Threading.Tasks.Task`1" /> has already been disposed.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> state.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>True if the operation was successful; false if the operation was unsuccessful or the object has already been disposed.</para>
</returns>
</Docs>
</Member>
<Member MemberName="TrySetException">
<MemberSignature Language="C#" Value="public bool TrySetException (System.Collections.Generic.IEnumerable<Exception> exceptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetException(class System.Collections.Generic.IEnumerable`1<class System.Exception> exceptions) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exceptions" Type="System.Collections.Generic.IEnumerable<System.Exception>" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This operation will return false if the <see cref="T:System.Threading.Tasks.Task`1" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>True if the operation was successful; otherwise, false.</para>
</returns>
<param name="exceptions">
<attribution license="cc4" from="Microsoft" modified="false" />The collection of exceptions to bind to this <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName="TrySetException">
<MemberSignature Language="C#" Value="public bool TrySetException (Exception exception);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetException(class System.Exception exception) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="exception" Type="System.Exception" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This operation will return false if the <see cref="T:System.Threading.Tasks.Task`1" /> is already in one of the three final states: <see cref="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />, <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" />, or <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Attempts to transition the underlying <see cref="T:System.Threading.Tasks.Task`1" /> into the <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>True if the operation was successful; otherwise, false.</para>
</returns>
<param name="exception">
<attribution license="cc4" from="Microsoft" modified="false" />The exception to bind to this <see cref="T:System.Threading.Tasks.Task`1" />.</param>
</Docs>
</Member>
<Member MemberName="TrySetResult">
<MemberSignature Language="C#" Value="public bool TrySetResult (TResult result);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool TrySetResult(!TResult result) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="result" Type="TResult" />
</Parameters>
<Docs>
<param name="result">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
|