Пример #1
0
        /// <summary>
        /// Get the largest index for the
        /// properties/fields and references.
        /// </summary>
        /// <returns>The max index.</returns>
        public virtual int GetMaxIndex()
        {
            if (ParameterMaps.Count == 0 && PropertyMaps.Count == 0 && ReferenceMaps.Count == 0)
            {
                return(-1);
            }

            var indexes = new List <int>();

            if (ParameterMaps.Count > 0)
            {
                indexes.AddRange(ParameterMaps.Select(parameterMap => parameterMap.GetMaxIndex()));
            }

            if (PropertyMaps.Count > 0)
            {
                indexes.Add(PropertyMaps.Max(pm => pm.Data.Index));
            }

            if (ReferenceMaps.Count > 0)
            {
                indexes.AddRange(ReferenceMaps.Select(referenceMap => referenceMap.GetMaxIndex()));
            }

            return(indexes.Max());
        }
Пример #2
0
        /// <summary>
        /// Get the largest index for the
        /// properties and references.
        /// </summary>
        /// <returns>The max index.</returns>
        internal int GetMaxIndex()
        {
            if (PropertyMaps.Count == 0 && ReferenceMaps.Count == 0)
            {
                return(IndexStart);
            }

            var indexes = new List <int> {
                PropertyMaps.Max(pm => pm.Data.Index)
            };

            indexes.AddRange(ReferenceMaps.Select(referenceMap => referenceMap.GetMaxIndex()));

            return(indexes.Max());
        }
Пример #3
0
        /// <summary>
        ///     Get the largest index for the
        ///     properties and references.
        /// </summary>
        /// <returns>The max index.</returns>
        internal int GetMaxIndex()
        {
            if (PropertyMaps.Count == 0 && ReferenceMaps.Count == 0)
            {
                return(-1);
            }
            var nums = new List <int>();

            if (PropertyMaps.Count > 0)
            {
                nums.Add(PropertyMaps.Max(pm => pm.Data.Index));
            }
            nums.AddRange(
                from referenceMap in ReferenceMaps
                select referenceMap.GetMaxIndex());
            return(nums.Max());
        }