The WebFeatureLayer.DiscardEditsAsync method redraws the web feature layer from the server and discards any unsynchronized edits in the drawing for the specified layer.
Declaration
public async Task<bool> Esri.ArcGISForAutoCAD.WebFeatureLayer.DiscardEditsAsync(Document doc, string flName)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing web feature layer name in the drawing. | required |
Returns
| Type | Description |
|---|---|
bool | true if the unsynchronized edits were discarded successfully |
Remarks on error conditions
This method may throw an exception or return false or null if a parameter is invalid.
Example
Print the success of discarding all existing unsynchronized edits on the Shelters web feature layer.// Initialize
Document doc = Application.DocumentManager.MdiActiveDocument;
// Discard edits
var success = await Esri.ArcGISForAutoCAD.WebFeatureLayer.DiscardEditsAsync(doc, "Shelters");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
See also
WebFeatureLayer.SynchronizeAsync —A .NET method that allows you to programmatically synchronize changes.
WebFeatureLayer.EditCounts—A .NET method that returns the number of pending changes to the specified web feature layer.
WebFeatureLayer.HasEdits—A .NET method that returns true if the web feature layer contains edits that have not yet been committed to the source feature service.
esri_webfeaturelayer_discardedits—An AutoLISP function that redraws the web feature layer from the server and discards any unsynchronized edits in the drawing for the specified layer.