PageRenderTime 165ms CodeModel.GetById 162ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/MartianGuiControls/Utils.cs

https://code.google.com/p/martian-gui-controls/
C# | 26 lines | 20 code | 5 blank | 1 comment | 0 complexity | b0e72dab875e8eb6cf1b902e7551ce39 MD5 | raw file
 1// Published under http://www.opensource.org/licenses/BSD-3-Clause license, see license.txt file for details.
 2
 3using System.Collections.Generic;
 4
 5namespace MartianGuiControls
 6{
 7	internal class Set<T>
 8	{
 9		private readonly Dictionary<T, object> _d = new Dictionary<T, object>(); // TODO change container
10
11		public void Add(T v)
12		{
13			_d.Add(v, null);
14		}
15
16		public bool Contains(T v)
17		{
18			return _d.ContainsKey(v);
19		}
20
21		public void Remove(T v)
22		{
23			_d.Remove(v);
24		}
25	}
26}