Пример #1
0
        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);
                }
            }
        }
Пример #2
0
        public string GetNext()
        {
            int    index = 0;
            string name;

            for (;;)
            {
                name = NameMaker.UniqueName(index++);
                if (!names.Contains(name))
                {
                    return(name);
                }
            }
        }