[Modify] Add it

This commit is contained in:
sta 2017-12-19 15:09:11 +09:00
parent ef175961ec
commit 62d4403b43

View File

@ -197,6 +197,25 @@ namespace WebSocketSharp
: stream.ToByteArray (); : stream.ToByteArray ();
} }
internal static bool Contains (
this NameValueCollection collection,
string name,
string value,
StringComparison comparisonTypeForValue
)
{
var val = collection[name];
if (val == null)
return false;
foreach (var elm in val.Split (',')) {
if (elm.Trim ().Equals (value, comparisonTypeForValue))
return true;
}
return false;
}
internal static bool Contains<T> ( internal static bool Contains<T> (
this IEnumerable<T> source, Func<T, bool> condition this IEnumerable<T> source, Func<T, bool> condition
) )