I am running an EditOperation in my add-in, but after I call the ExecuteAsync method and look at the Edit tab, the Save button is activated. This is a problem, since the next step in the process is to run a dissolve on the edited layer. I get the error message that the dissolve cannot run since the layer is being edited.
In this code, I'm modifying two fields and saving the edits. Why aren't they being properly saved?
QueryFilter queryFilter = new QueryFilter { WhereClause = "1=1" };
EditOperation editOperation = new EditOperation();
Inspector inspector;
editOperation.ShowProgressor = true;
await QueuedTask.Run(() =>
{
using (RowCursor rowCursor = featureClass.Search(queryFilter, false))
{
while (rowCursor.MoveNext())
{
using (Row record = rowCursor.Current)
{
inspector = new Inspector();
inspector.Load(record);
inspector["PS_Count"] = 1;
if (geometryType == GeometryType.Polygon)
{
var feature = (Feature)record;
inspector["PS_Area"] = GeometryEngine.Instance.GeodesicArea(feature.GetShape());
}
editOperation.Modify(inspector);
}
}
}
});
try
{
bool result = await editOperation.ExecuteAsync();
if (!result) message = editOperation.ErrorMessage;
}