ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.Attributes Namespace / Inspector Class / Inspector Constructor
Example

In This Topic
    Inspector Constructor
    In This Topic
    Create a new instance of the inspector class.
    Syntax
    Public Function New()
    public Inspector()
    Example
    Load a feature from a layer into the inspector
    {
      // Loads a feature from the specified feature layer into an Inspector instance.
      // create an instance of the inspector class
      var inspector = new Inspector();
      // load the feature with ObjectID 'objectId' into the inspector
      await inspector.LoadAsync(featureLayer, objectId);
    }
    Inspector.AddValidate
    // Adds a custom validation rule to the "Mineral" field of the specified feature layer.
    await QueuedTask.Run(() =>
    {
      var insp = new Inspector();
      insp.LoadSchema(featureLayer);
      var attrib = insp.Where(a => a.FieldName == "Mineral").First();
      attrib.AddValidate(() =>
      {
        if (attrib.CurrentValue.ToString() == "Salt")
          return [];
        else return [ArcGIS.Desktop.Editing.Attributes.Attribute.ValidationError.Create("Error", Severity.Low)];
      });
    });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also