Refactored a few for HttpListenerResponse.cs
This commit is contained in:
parent
0ecbca86e9
commit
9ad62f6a5f
@ -121,9 +121,6 @@ namespace WebSocketSharp.Net
|
|||||||
/// A <see cref="Encoding"/> that represents the encoding for the entity body data,
|
/// A <see cref="Encoding"/> that represents the encoding for the entity body data,
|
||||||
/// or <see langword="null"/> if no encoding is specified.
|
/// or <see langword="null"/> if no encoding is specified.
|
||||||
/// </value>
|
/// </value>
|
||||||
/// <exception cref="InvalidOperationException">
|
|
||||||
/// The response has already been sent.
|
|
||||||
/// </exception>
|
|
||||||
/// <exception cref="ObjectDisposedException">
|
/// <exception cref="ObjectDisposedException">
|
||||||
/// This object is closed.
|
/// This object is closed.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
@ -133,17 +130,16 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
checkDisposedOrHeadersSent ();
|
checkDisposed ();
|
||||||
_contentEncoding = value;
|
_contentEncoding = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size of the entity body data included in the response.
|
/// Gets or sets the number of bytes in the entity body data included in the response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="long"/> that represents the value of the Content-Length entity-header.
|
/// A <see cref="long"/> that represents the value of the Content-Length entity-header.
|
||||||
/// The value is a number of bytes in the entity body data.
|
|
||||||
/// </value>
|
/// </value>
|
||||||
/// <exception cref="ArgumentOutOfRangeException">
|
/// <exception cref="ArgumentOutOfRangeException">
|
||||||
/// The value specified for a set operation is less than zero.
|
/// The value specified for a set operation is less than zero.
|
||||||
@ -173,17 +169,13 @@ namespace WebSocketSharp.Net
|
|||||||
/// Gets or sets the media type of the entity body included in the response.
|
/// Gets or sets the media type of the entity body included in the response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// A <see cref="string"/> that represents the value of the Content-Type entity-header.
|
/// A <see cref="string"/> that represents the media type of the entity body,
|
||||||
|
/// or <see langword="null"/> if no media type is specified. This value is
|
||||||
|
/// used for the value of the Content-Type entity-header.
|
||||||
/// </value>
|
/// </value>
|
||||||
/// <exception cref="ArgumentNullException">
|
|
||||||
/// The value specified for a set operation is <see langword="null"/>.
|
|
||||||
/// </exception>
|
|
||||||
/// <exception cref="ArgumentException">
|
/// <exception cref="ArgumentException">
|
||||||
/// The value specified for a set operation is empty.
|
/// The value specified for a set operation is empty.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
/// <exception cref="InvalidOperationException">
|
|
||||||
/// The response has already been sent.
|
|
||||||
/// </exception>
|
|
||||||
/// <exception cref="ObjectDisposedException">
|
/// <exception cref="ObjectDisposedException">
|
||||||
/// This object is closed.
|
/// This object is closed.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
@ -193,11 +185,8 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
checkDisposedOrHeadersSent ();
|
checkDisposed ();
|
||||||
if (value == null)
|
if (value != null && value.Length == 0)
|
||||||
throw new ArgumentNullException ("value");
|
|
||||||
|
|
||||||
if (value.Length == 0)
|
|
||||||
throw new ArgumentException ("An empty string.", "value");
|
throw new ArgumentException ("An empty string.", "value");
|
||||||
|
|
||||||
_contentType = value;
|
_contentType = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user