public Key RemoveItem(String name) { ++directoryVersion; StringDictionary pset = new StringDictionary(GetDataFile(propertySetKey)); long id = pset.GetValue <long>(name, -1); // Assert the item is stored, if (id == -1) { throw new ApplicationException("Item not found: " + name); } pset.SetValue(name, null); SortedIndex iset = new SortedIndex(GetDataFile(indexSetKey)); iset.Remove(name, id, collator); // Delete the associated datafile Key k = GetItemKey(id); IDataFile df = GetDataFile(k); df.Delete(); return(k); }
private void RemoveRowFromIndexSet(long rowid) { // Get the set of columns that are indexed in this table, string[] indexedCols = IndexedColumns; // For each index, foreach (String col in indexedCols) { // Resolve the column name to an id, turn it into a OrderedList64Bit, // and insert the row in the correct location in the index, long columnid = GetColumnId(col); IDataFile df = GetDataFile(GetIndexIdKey(columnid)); SortedIndex index = new SortedIndex(df); IIndexedObjectComparer <string> indexComparer = GetIndexComparerFor(col, columnid); index.Remove(GetValue(rowid, columnid), rowid, indexComparer); } }