External/OxyPlot/OxyPlot.WindowsForms/HashSet.cs
author moel.mich
Tue, 30 Dec 2014 16:02:52 +0000
changeset 428 3c1cdc197b24
permissions -rw-r--r--
Added a new "Undefined" control mode. Changed the GPU fan control to restore to default (auto) settings when the Open Hardware Monitor closes (unless the control remained in "Undefined" mode).
moel@392
     1

moel@392
     2
namespace OxyPlot.WindowsForms {
moel@392
     3
  using System;
moel@392
     4
  using System.Collections.Generic;
moel@392
     5
  using System.Text;
moel@392
     6
moel@392
     7
  public class HashSet<T> {
moel@392
     8
moel@392
     9
    private readonly Dictionary<T, object> set = new Dictionary<T, object>();
moel@392
    10
moel@392
    11
    public bool Add(T value) {
moel@392
    12
      if (set.ContainsKey(value))
moel@392
    13
        return true;
moel@392
    14
moel@392
    15
      set.Add(value, null);
moel@392
    16
      return false;
moel@392
    17
    }
moel@392
    18
moel@392
    19
    public bool Contains(T value) {
moel@392
    20
      return set.ContainsKey(value);
moel@392
    21
    }
moel@392
    22
moel@392
    23
    public void Clear() {
moel@392
    24
      set.Clear();
moel@392
    25
    }
moel@392
    26
  }
moel@392
    27
}