1
0
mirror of https://github.com/romanlryji/EventLogLoader.git synced 2025-12-07 23:23:44 +02:00
Files
EventLogLoader/EventLogApp/EventElements/EventElementsDictionary.cs
2019-10-02 11:18:07 +03:00

28 lines
696 B
C#

//using Nest;
using System.Collections.Generic;
namespace EventLogApp
{
internal class EventElementsDictionary<T> : Dictionary<long, T> where T : CodeNameType
{
//private Dictionary<int, T> dictionary = new Dictionary<int, T>();
public EventElementsDictionary() : base() { }
EventElementsDictionary(int capacity) : base(capacity) { }
public void Add(T item)
{
if (typeof(T).IsSubclassOf(typeof(CodeNameGuidType)))
{
if (base.ContainsKey(item.Code))
{
base.Remove(item.Code);
}
}
base.Add(item.Code, item);
}
}
}