[Modify] Throw an exception if read-only
This commit is contained in:
parent
449e38c239
commit
e111cc2ee2
@ -628,11 +628,19 @@ namespace WebSocketSharp.Net
|
|||||||
/// <param name="cookies">
|
/// <param name="cookies">
|
||||||
/// A <see cref="CookieCollection"/> that contains the cookies to add.
|
/// A <see cref="CookieCollection"/> that contains the cookies to add.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <exception cref="InvalidOperationException">
|
||||||
|
/// The collection is read-only.
|
||||||
|
/// </exception>
|
||||||
/// <exception cref="ArgumentNullException">
|
/// <exception cref="ArgumentNullException">
|
||||||
/// <paramref name="cookies"/> is <see langword="null"/>.
|
/// <paramref name="cookies"/> is <see langword="null"/>.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public void Add (CookieCollection cookies)
|
public void Add (CookieCollection cookies)
|
||||||
{
|
{
|
||||||
|
if (_readOnly) {
|
||||||
|
var msg = "The collection is read-only.";
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (cookies == null)
|
if (cookies == null)
|
||||||
throw new ArgumentNullException ("cookies");
|
throw new ArgumentNullException ("cookies");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user