src/Foundation/Net/Gimela.Net.Http/Messages/ResponseCookieCollection.cs
/// <summary>
/// Adds a cookie in the collection.
/// </summary>
/// <param name="cookie">cookie to add</param>
/// <exception cref="ArgumentNullException">cookie is <c>null</c></exception>
/// <exception cref="ArgumentException">Name and Content must be specified.</exception>
Adds a cookie in the collection.
Adds a cookie in the collection .
public void Add(ResponseCookie cookie)
    {
      if (cookie == null)
        throw new ArgumentNullException("cookie");
      if (cookie.Name == null || cookie.Name.Trim() == string.Empty)
        throw new ArgumentException("Name must be specified.");
      if (cookie.Value == null || cookie.Value.Trim() == string.Empty)
        throw new ArgumentException("Content must be specified.");
      if (_items.ContainsKey(cookie.Name))
        _items[cookie.Name] = cookie;
      else _items.Add(cookie.Name, cookie);
    }
public void Add ( ResponseCookie cookie ) { if ( cookie == null ) throw new ArgumentNullException ( " " ) ; if ( cookie . Name == null || cookie . Name . Trim ( ) == string . Empty ) throw new ArgumentException ( " " ) ; if ( cookie . Value == null || cookie . Value . Trim ( ) == string . Empty ) throw new ArgumentException ( " " ) ; if ( _items . ContainsKey ( cookie . Name ) ) _items [ cookie . Name ] = cookie ; else _items . Add ( cookie . Name , cookie ) ; }
Adds a cookie in the collection.
Adds a cookie in the collection .
// Verifies the parameter
cookie is null
cookie is null
Name and Content must be specified.
Name and Content must be specified .
cookie
ResponseCookie
cookie to add
cookie to add