using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
namespace EmbedIO.Net.Internal
{
///
/// Represents a wrapper for System.Net.CookieCollection.
///
///
internal sealed class SystemCookieCollection : ICookieCollection
{
private readonly CookieCollection _collection;
///
/// Initializes a new instance of the class.
///
/// The cookie collection.
public SystemCookieCollection(CookieCollection collection)
{
_collection = collection;
}
///
public int Count => _collection.Count;
///
public bool IsSynchronized => _collection.IsSynchronized;
///
public object SyncRoot => _collection.SyncRoot;
///
public Cookie? this[string name] => _collection[name];
///
IEnumerator IEnumerable.GetEnumerator() => _collection.OfType().GetEnumerator();
///
public IEnumerator GetEnumerator() => _collection.GetEnumerator();
///
public void CopyTo(Array array, int index) => _collection.CopyTo(array, index);
///
public void CopyTo(Cookie[] array, int index) => _collection.CopyTo(array, index);
///
public void Add(Cookie cookie) => _collection.Add(cookie);
///
public bool Contains(Cookie cookie) => _collection.OfType().Contains(cookie);
}
}