/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. using System.Collections.Generic;
  3. namespace MartianGuiControls
  4. {
  5. internal class Set<T>
  6. {
  7. private readonly Dictionary<T, object> _d = new Dictionary<T, object>(); // TODO change container
  8. public void Add(T v)
  9. {
  10. _d.Add(v, null);
  11. }
  12. public bool Contains(T v)
  13. {
  14. return _d.ContainsKey(v);
  15. }
  16. public void Remove(T v)
  17. {
  18. _d.Remove(v);
  19. }
  20. }
  21. }