public void AddValidate( Func<IEnumerable<Attribute.ValidationError>> f )
Public Sub AddValidate( _ ByVal f As Func(Of IEnumerable(Of Attribute.ValidationError)) _ )
Parameters
- f
- an anonymous method
public void AddValidate( Func<IEnumerable<Attribute.ValidationError>> f )
Public Sub AddValidate( _ ByVal f As Func(Of IEnumerable(Of Attribute.ValidationError)) _ )
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
var insp = new Inspector(); insp.LoadSchema(featLayer); var attrib = insp.Where(a => a.FieldName == "Mineral").First(); attrib.AddValidate(() => { if (attrib.CurrentValue.ToString() == "Salt") return Enumerable.Empty<ArcGIS.Desktop.Editing.Attributes.Attribute.ValidationError>(); else return new[] { ArcGIS.Desktop.Editing.Attributes.Attribute.ValidationError.Create("Error", ArcGIS.Desktop.Editing.Attributes.Severity.Low) }; });
Target Platforms: Windows 11, Windows 10