External/OxyPlot/OxyPlot.WindowsForms/HashSet.cs
author StephaneLenclud
Thu, 18 Apr 2013 23:25:10 +0200
branchMiniDisplay
changeset 444 9b09e2ee0968
permissions -rw-r--r--
Front View plug-in does not init if no sensor added.
Fixing some format to make strings shorter.
Now trying to start SoundGraphAccess.exe process from same directory.
Packed mode now can display three sensors along with the current time.
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
}