using System;
using System.Collections.Generic;
using System.Text;

namespace EonaCat.LogStack.Extensions
{
    internal static class DictionaryExtensions
    {
        public static bool TryAdd<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue value)
        {
            if (!dict.ContainsKey(key))
            {
                dict[key] = value;
                return true;
            }
            return false;
        }
    }
}
