private void NoDupDirs(Directory[] dirs)
{
HashSet<Directory> dups = new HashSet<Directory>();
for (int i = 0; i < dirs.Length; i++)
{
if (dups.Contains(dirs[i]))
{
throw new System.ArgumentException("Directory " + dirs[i] + " appears more than once");
}
if (dirs[i] == directory)
throw new System.ArgumentException("Cannot add directory to itself");
dups.Add(dirs[i]);
}
}