I am implementing an Undo/Redo for deletion of roads in my shapefiles. When a road is deleted I add it to an InMemoryFeatureLayer that is not visible and delete it from the shapefile. If the user undoes that action, I add it back to the shapefile and also add it to a Redo dictionary containing the feature and the layer it came from. When the user clicks redo (enabled only after an undo was executed), I find the layer the last undo feature was added to and attempt to delete the last item added. I have other logic in the program to clear the redo stack when necessary. Anyways, in order to avoid pulling in the entire collection of features from the ShapeFileFeatureLayer and finding the ID of the last one in the collection, which can take up to a minute with some of the shapefiles being used, I would like to query for the last item added. Is there any way to get this information other than pull all features from the shapefile and reference the last item in the list?
In short, is there a simple method to delete the last feature added to a shapefile/ShapefileFeatureLayer or at least get the ID for the last feature added?