Skip To Content

WebFeatureLayer.EditCounts (.NET)

The WebFeatureLayer.EditCounts method returns the number of pending changes to the specified web feature layer. It returns the number of additions, deletions, and modifications. Use this method before synchronization to determine expected changes.

Declaration

public Dictionary<string, int> Esri.ArcGISForAutoCAD.WebFeatureLayer.EditCounts(Document doc, string flName)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing web feature layer name in the drawing.

required

Returns

TypeDescription

Dictionary<string, int>

A dictionary of the edit count types and edit count values. Key: edit count type as string, Value: edit count as int.

  • Additions—The number of features that will be added to the feature layer upon synchronization.
  • Deletions—The number of features that will be deleted from the feature layer upon synchronization.
  • Modified—The number of features that will be modified in the feature layer upon synchronization.

Remarks on error conditions

This method may throw an exception or return null if a parameter is invalid.

Example

Print the edit counts for the Shelters web feature layer.

// Initialize
Document doc = Application.DocumentManager.MdiActiveDocument;

// Get the edit counts
var editCounts = Esri.ArcGISForAutoCAD.WebFeatureLayer.EditCounts(doc, "Shelters");

// Print the edit counts
foreach (var editCount in editCounts)
{
  doc.Editor.WriteMessage("\n{0}: {1}", editCount.Key, editCount.Value);
}

/* Example output
Additions: 1
Deletions: 0
Modified: 3
*/

See also

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.

WebFeatureLayer.SynchronizeAsync —A .NET method that allows you to programmatically synchronize changes.

WebFeatureLayer.DiscardEditsAsync—A .NET method that redraws the web feature layer from the server and discards any unsynchronized edits in the drawing for the specified layer.

esri_webfeaturelayer_editcounts—An AutoLISP function that returns the number of pending changes to the specified layer.