Clean up doc comments for PushStreamContent (#311)
Fixes https://github.com/aspnet/AspNetWebStack/issues/310
This commit is contained in:
Родитель
c55dd95aeb
Коммит
d1df0c8297
|
@ -14,7 +14,7 @@ namespace System.Net.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides an <see cref="HttpContent"/> implementation that exposes an output <see cref="Stream"/>
|
/// Provides an <see cref="HttpContent"/> implementation that exposes an output <see cref="Stream"/>
|
||||||
/// which can be written to directly. The ability to push data to the output stream differs from the
|
/// which can be written to directly. The ability to push data to the output stream differs from the
|
||||||
/// <see cref="StreamContent"/> where data is pulled and not pushed.
|
/// <see cref="StreamContent"/> where data is pulled and not pushed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PushStreamContent : HttpContent
|
public class PushStreamContent : HttpContent
|
||||||
|
@ -24,8 +24,8 @@ namespace System.Net.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class. The
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class. The
|
||||||
/// <paramref name="onStreamAvailable"/> action is called when an output stream
|
/// <paramref name="onStreamAvailable"/> action is called when an output stream
|
||||||
/// has become available allowing the action to write to it directly. When the
|
/// has become available allowing the action to write to it directly. When the
|
||||||
/// stream is closed, it will signal to the content that is has completed and the
|
/// stream is closed, it will signal to the content that it has completed and the
|
||||||
/// HTTP request or response will be completed.
|
/// HTTP request or response will be completed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
|
/// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
|
||||||
|
@ -35,10 +35,11 @@ namespace System.Net.Http
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class.
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="onStreamAvailable">The action to call when an output stream is available. The stream is automatically
|
/// <param name="onStreamAvailable">The action to call when an output stream is available. When the
|
||||||
/// closed when the return task is completed.</param>
|
/// output stream is closed or disposed, it will signal to the content that it has completed and the
|
||||||
|
/// HTTP request or response will be completed.</param>
|
||||||
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable)
|
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable)
|
||||||
: this(onStreamAvailable, (MediaTypeHeaderValue)null)
|
: this(onStreamAvailable, (MediaTypeHeaderValue)null)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +48,8 @@ namespace System.Net.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
|
||||||
|
/// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
|
||||||
public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamAvailable, string mediaType)
|
public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamAvailable, string mediaType)
|
||||||
: this(Taskify(onStreamAvailable), new MediaTypeHeaderValue(mediaType))
|
: this(Taskify(onStreamAvailable), new MediaTypeHeaderValue(mediaType))
|
||||||
{
|
{
|
||||||
|
@ -55,6 +58,10 @@ namespace System.Net.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="onStreamAvailable">The action to call when an output stream is available. When the
|
||||||
|
/// output stream is closed or disposed, it will signal to the content that it has completed and the
|
||||||
|
/// HTTP request or response will be completed.</param>
|
||||||
|
/// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
|
||||||
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable, string mediaType)
|
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable, string mediaType)
|
||||||
: this(onStreamAvailable, new MediaTypeHeaderValue(mediaType))
|
: this(onStreamAvailable, new MediaTypeHeaderValue(mediaType))
|
||||||
{
|
{
|
||||||
|
@ -63,6 +70,8 @@ namespace System.Net.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
|
||||||
|
/// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
|
||||||
public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamAvailable, MediaTypeHeaderValue mediaType)
|
public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamAvailable, MediaTypeHeaderValue mediaType)
|
||||||
: this(Taskify(onStreamAvailable), mediaType)
|
: this(Taskify(onStreamAvailable), mediaType)
|
||||||
{
|
{
|
||||||
|
@ -71,6 +80,10 @@ namespace System.Net.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
|
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="onStreamAvailable">The action to call when an output stream is available. When the
|
||||||
|
/// output stream is closed or disposed, it will signal to the content that it has completed and the
|
||||||
|
/// HTTP request or response will be completed.</param>
|
||||||
|
/// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
|
||||||
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable, MediaTypeHeaderValue mediaType)
|
public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStreamAvailable, MediaTypeHeaderValue mediaType)
|
||||||
{
|
{
|
||||||
if (onStreamAvailable == null)
|
if (onStreamAvailable == null)
|
||||||
|
@ -98,8 +111,8 @@ namespace System.Net.Http
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When this method is called, it calls the action provided in the constructor with the output
|
/// When this method is called, it calls the action provided in the constructor with the output
|
||||||
/// stream to write to. Once the action has completed its work it closes the stream which will
|
/// stream to write to. Once the action has completed its work it closes the stream which will
|
||||||
/// close this content instance and complete the HTTP request or response.
|
/// close this content instance and complete the HTTP request or response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stream">The <see cref="Stream"/> to which to write.</param>
|
/// <param name="stream">The <see cref="Stream"/> to which to write.</param>
|
||||||
|
@ -142,8 +155,8 @@ namespace System.Net.Http
|
||||||
|
|
||||||
#if NETFX_CORE
|
#if NETFX_CORE
|
||||||
[SuppressMessage(
|
[SuppressMessage(
|
||||||
"Microsoft.Usage",
|
"Microsoft.Usage",
|
||||||
"CA2215:Dispose methods should call base class dispose",
|
"CA2215:Dispose methods should call base class dispose",
|
||||||
Justification = "See comments, this is intentional.")]
|
Justification = "See comments, this is intentional.")]
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче