public void AddNewIndex(XPathNavigator context, int indexId, XmlILIndex index) {
XPathNavigator navRoot;
ArrayList docIndexes;
Debug.Assert(context != null);
// Get root of document
navRoot = context.Clone();
navRoot.MoveToRoot();
// Ensure that a slot exists for the new index
if (this.indexes == null) {
this.indexes = new ArrayList[indexId + 4];
}
else if (indexId >= this.indexes.Length) {
// Resize array
ArrayList[] indexesNew = new ArrayList[indexId + 4];
Array.Copy(this.indexes, 0, indexesNew, 0, this.indexes.Length);
this.indexes = indexesNew;
}
docIndexes = (ArrayList) this.indexes[indexId];
if (docIndexes == null) {
docIndexes = new ArrayList();
this.indexes[indexId] = docIndexes;
}
docIndexes.Add(navRoot);
docIndexes.Add(index);
}