Parameters
- index
- The index of the field.
Return Value
The value of the field.
Exception | Description |
---|---|
System.ArgumentException | The index argument is out of range. |
ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
ArcGIS.Core.Geometry.Exceptions.GeometryException | index corresponds to a shape field index and the type of shape (i.e., geometry) is not supported. |
private static FeatureLayer featureLayer; private static void DetermineGeometryChange() { featureLayer = MapView.Active?.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); if (featureLayer == null) return; QueuedTask.Run(() => { //Listen to the RowChangedEvent that occurs when a Row is changed. ArcGIS.Desktop.Editing.Events.RowChangedEvent.Subscribe(OnRowChangedEvent2, featureLayer.GetTable()); }); } private static void OnRowChangedEvent2(RowChangedEventArgs args) { // RowEvent callbacks are always called on the QueuedTask so there is no need // to wrap your code within a QueuedTask.Run lambda. //Get the layer's definition var lyrDefn = featureLayer.GetFeatureClass().GetDefinition(); //Get the shape field of the feature class string shapeField = lyrDefn.GetShapeField(); //Index of the shape field var shapeIndex = lyrDefn.FindField(shapeField); //Original geometry of the modified row var geomOrig = args.Row.GetOriginalValue(shapeIndex) as Geometry; //New geometry of the modified row var geomNew = args.Row[shapeIndex] as Geometry; //Compare the two bool shapeChanged = geomOrig.IsEqual(geomNew); }
//Return the page number that corresponds to the page name field for an index feature Layout layout = LayoutView.Active.Layout; //Perform on the worker thread await QueuedTask.Run(() => { SpatialMapSeries SMS = layout.MapSeries as SpatialMapSeries; Row msRow = SMS.CurrentRow; System.Windows.MessageBox.Show(SMS.FindPageNumber(msRow.GetOriginalValue(msRow.FindField("NAME")).ToString())); });
Target Platforms: Windows 11, Windows 10, Windows 8.1