I've built an add-in with several buttons which initiate an editing session to perform their actions. I would like to push the operation to ArcMap's operation stack so the undo/redo buttons are enabled, but I can't figure out how.
Here is a snippet of the action of one button. This one reduces the font size of all selected features. Is it possible to add this operation to the stack after it is used?
IFeatureLayer currLayer = currMap.Layer[j] as IFeatureLayer;
ISelectionSet ss = ((IFeatureSelection)currLayer).SelectionSet;
if(ss.Count > 0 && currLayer.FeatureClass.FindField(attributeName) > -1)
IWorkspaceEdit wse = ((IDataset)currLayer.FeatureClass).Workspace as IWorkspaceEdit;
//Update all annotations in the selection set
IEnumIDs ids = ss.IDs;
int id = ids.Next();
while(id > -1)
currFeature = currLayer.FeatureClass.GetFeature(id);
attributeIndex = currFeature.Class.FindField(attributeName);
currFeature.Value[attributeIndex] = currFeature.Value[attributeIndex] - 0.5;
id = ids.Next();