/// <summary> /// Appends the index and data values for the specified channel identifier. /// </summary> /// <param name="channelId">The channel identifier.</param> /// <param name="indexes">The index values.</param> /// <param name="value">The data value.</param> public void Append(long channelId, IList <object> indexes, object value) { var primaryIndex = indexes.First(); List <List <object> > record; // Check if primary index has been added before if (!_recordsByIndex.TryGetValue(primaryIndex, out record)) { record = new List <List <object> >() { new List <object>() { primaryIndex }, new List <object>() }; _records.Add(record); _recordsByIndex[primaryIndex] = record; } var position = ChannelIds.IndexOf(channelId); var channelIndexes = record[0]; var channelValues = record[1]; // Secondary indexes if (indexes.Count > 1) { channelIndexes.AddRange(indexes); } // Ensure available channel value slots for (int i = channelValues.Count; i < ChannelIds.Count; i++) { channelValues.Add(null); } // Channel value channelValues[position] = value; }