FastQuant.DataSeries.InsertKey C# (CSharp) Method

InsertKey() private method

private InsertKey ( DataKey key, DataKey keyAt ) : void
key DataKey
keyAt DataKey
return void
        private void InsertKey(DataKey key, DataKey keyAt)
        {
            for (int i = this.bufferCount; i > keyAt.number + 1; i--)
            {
                this.cache[i] = this.cache[i - 1];
                if (this.cache[i] != null)
                    this.cache[i].number = i;
            }
            this.bufferCount++;
            key.number = keyAt.number + 1;
            this.cache[key.number] = key;
            key.prev = keyAt.position;
            key.next = keyAt.next;
            WriteKey(key);
            this.file.WriteKey(this.key);
        }