public static string GetNext(IEnumerable <NameGroup> groups) { int index = 0; string name; for (;;) { name = NameMaker.UniqueName(index++); bool contained = false; foreach (NameGroup group in groups) { if (group.Contains(name)) { contained = true; break; } } if (!contained) { return(name); } } }
public string GetNext() { int index = 0; string name; for (;;) { name = NameMaker.UniqueName(index++); if (!names.Contains(name)) { return(name); } } }