コード例 #1
0
        private void SetMinMaxRowOffset(int rowIndex, int recordOffset)
        {
            if (!RowMinMaxOffsets.TryGetValue(rowIndex, out var minMax))
            {
                minMax = new KeyValuePair <int, int>(int.MaxValue, int.MinValue);
            }

            RowMinMaxOffsets[rowIndex] = new KeyValuePair <int, int>(
                Math.Min(minMax.Key, recordOffset),
                Math.Max(minMax.Value, recordOffset));
        }
コード例 #2
0
        private bool GetMinMaxOffsetsForRowBlock(int rowIndex, int rowCount, out int minOffset, out int maxOffset)
        {
            minOffset = int.MaxValue;
            maxOffset = int.MinValue;

            for (var i = 0; i < rowCount; i++)
            {
                if (RowMinMaxOffsets.TryGetValue(rowIndex + i, out var minMax))
                {
                    minOffset = Math.Min(minOffset, minMax.Key);
                    maxOffset = Math.Max(maxOffset, minMax.Value);
                }
            }

            return(minOffset != int.MaxValue);
        }