

Public NotInheritable Class Attribute Inherits ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase Implements System.ComponentModel.INotifyPropertyChanged
public sealed class Attribute : ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase, System.ComponentModel.INotifyPropertyChanged
// Loads the schema of the specified feature layer and iterates through its attributes, providing access to their properties such as field name, alias, type, and other metadata. await QueuedTask.Run(() => { // create an instance of the inspector class var inspector = new Inspector(); // load the layer inspector.LoadSchema(featureLayer); // 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; } });
{
var oid = 1;
// See "Change Annotation Text Graphic" for an alternative if TEXTSTRING is missing from the schema
// Note: QueuedTask is required to access the Inspector
{
// use the inspector methodology
var insp = new Inspector();
insp.Load(annotationLayer, 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(annotationLayer, oid, newAtts);
op.Execute();
}
}
}
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Editing.Attributes.Attribute
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)