
public sealed class Attribute : ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase, System.ComponentModel.INotifyPropertyChanged
Public NotInheritable Class Attribute Inherits ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase Implements System.ComponentModel.INotifyPropertyChanged
QueuedTask.Run(() => { var firstFeatureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ArcGIS.Desktop.Mapping.FeatureLayer>().FirstOrDefault(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the layer inspector.LoadSchema(firstFeatureLayer); // iterate through the attributes, looking at properties foreach (var attribute in inspector) { var fldName = attribute.FieldName; var fldAlias = attribute.FieldAlias; var fldType = attribute.FieldType; int idxFld = attribute.FieldIndex; var fld = attribute.GetField(); var isNullable = attribute.IsNullable; var isEditable = attribute.IsEditable; var isVisible = attribute.IsVisible; var isSystemField = attribute.IsSystemField; var isGeometryField = attribute.IsGeometryField; } });
//See "Change Annotation Text Graphic" for an alternative if TEXTSTRING is missing from the schema await QueuedTask.Run(() => { //annoLayer is ~your~ Annotation layer... // use the inspector methodology var insp = new Inspector(); insp.Load(annoLayer, oid); // make sure TextString attribute exists. //It is not guaranteed to be in the schema ArcGIS.Desktop.Editing.Attributes.Attribute att = insp.FirstOrDefault(a => a.FieldName == "TEXTSTRING"); if (att != null) { insp["TEXTSTRING"] = "Hello World"; //create and execute the edit operation EditOperation op = new EditOperation(); op.Name = "Update annotation"; op.Modify(insp); //OR using a Dictionary - again TEXTSTRING has to exist in the schema //Dictionary<string, object> newAtts = new Dictionary<string, object>(); //newAtts.Add("TEXTSTRING", "hello world"); //op.Modify(annoLayer, oid, newAtts); op.Execute(); } });
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Editing.Attributes.Attribute
Target Platforms: Windows 11, Windows 10, Windows 8.1