External/OxyPlot/OxyPlot.WindowsForms/HashSet.cs
author StephaneLenclud
Sun, 03 Feb 2013 18:01:50 +0100
branchMiniDisplay
changeset 433 090259cfd699
permissions -rw-r--r--
Adding SoundGraphDisplay and SensorFrontView classes.
They were respectively based on SystemTray and SensorNotifyIcon.
SoundGraphDisplay is now able to load iMONDisplay.dll providing it lives on your PATH.
Adding option to sensor context menu for adding it into FrontView.
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
}