/// <summary> /// We're making an assumption that the tuples given to us are correct - that a tupleset can't contain /// multiple elements with the same context. /// </summary> protected void InsertRegularTuple(DataRow instRow, string tupleName, string colName, string markupData, int level) { TupleMarkup tm = new TupleMarkup((string)instRow[InstanceUtils._ElementIDCol], (string)instRow[InstanceUtils._parentIdCol], tupleName, level); int index = regularTupleMarkups.BinarySearch(tm, new ElementParentComparer()); if (index < 0) { tm.AddMarkup(colName, markupData, tupleName); tm.InstanceRow = instRow; regularTupleMarkups.Insert(~index, tm); } else { regularTupleMarkups[index].AddMarkup(colName, markupData, tupleName); regularTupleMarkups[index].TupleSetNames.Add(tupleName); } }
protected void InsertNestedTuple(DataRow instRow, string tupleName, string colName, string markupData, int level) { TupleMarkup tm = new TupleMarkup((string)instRow[InstanceUtils._ElementIDCol], (string)instRow[InstanceUtils._parentIdCol], tupleName, level); int index = nestedTupleMarkups.BinarySearch(tm); if (index < 0) { tm.AddMarkup(colName, markupData, tupleName); tm.InstanceRow = instRow; nestedTupleMarkups.Insert(~index, tm); } else { // this probably won't be hit nestedTupleMarkups[index].AddMarkup(colName, markupData, tupleName); nestedTupleMarkups[index].TupleSetNames.Add(tupleName); } }