Initial commit.

This commit is contained in:
Christian Kratky
2017-03-19 18:41:29 +01:00
parent bc50796f9d
commit 9b720d2325
70 changed files with 3487 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace MQTTnet.Core
{
public static class DictionaryExtensions
{
public static TValue Take<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
{
if (dictionary == null) throw new ArgumentNullException(nameof(dictionary));
TValue value;
if (dictionary.TryGetValue(key, out value))
{
dictionary.Remove(key);
}
return value;
}
}
}