Esempio n. 1
0
        private void getBaseTime(ulong time, out EventToken[,] block, out int index)
        {
            ulong baseTime = _history.Keys.Where(t => (t <= time)).DefaultIfEmpty(0UL).Max();
            if (!_history.ContainsKey(baseTime))
            {
                block = null;
                index = 0;
                return;
            }

            block = _history[baseTime];
            index = (int)(time - baseTime);
            if (index >= block.GetLength(1))
            {
                block = null;
                index = 0;
            }
        }
Esempio n. 2
0
        private int findEmptyRow(ref EventToken[,] block, int col)
        {
            bool found = false;
            int row;
            for (row = 0; row < block.GetLength(0); row++)
            {
                if (block[row, col] == null)
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                row = (++_rowCount) - 1;
                block = block.Resize(_rowCount, block.GetLength(1));
            }

            return row;
        }