Пример #1
0
        private Definition Find(IList <uint> numerical)
        {
            if (numerical == null)
            {
                throw new ArgumentNullException("numerical");
            }

            if (numerical.Count == 0)
            {
                throw new ArgumentException("numerical cannot be empty");
            }

            Definition result = _root;

// ReSharper disable LoopCanBePartlyConvertedToQuery
            foreach (uint digit in numerical)
// ReSharper restore LoopCanBePartlyConvertedToQuery
            {
                var temp = result.GetChildAt(digit) as Definition;
                if (temp == null)
                {
                    return(null);
                }

                result = temp;
            }

            return(result);
        }
Пример #2
0
        private Definition Find(IList <uint> numerical)
        {
            if (numerical == null)
            {
                throw new ArgumentNullException("numerical");
            }

            if (numerical.Count == 0)
            {
                throw new ArgumentException("numerical cannot be empty");
            }

            Definition result = _root;

            for (int i = 0; i < numerical.Count; i++)
            {
                Definition temp = result.GetChildAt(numerical[i]) as Definition;
                if (temp == null)
                {
                    return(null);
                }

                result = temp;
            }

            return(result);
        }