Provides access to members that manage rules and validate them.
Description
IValidation interface is a member of the ObjectClass coclass. It is used to maintain rules, and also to validate the workspace or object class based on the rules associated with it. Rules can be added, deleted, and validated through this interface. Also rule objects associated with the object class can be obtained from this interface.
When To Use
IValidation is the interface on a ObjectClass object used to add/delete rules, as well as validate those rules against the current object class. For example, use the IValidation interface to add a connectivity/attribute rule to this particular object class. You can then create a query filter based on this object class and use the validate function to see if there are any features that are considered invalid based on these rules.
Members
Name | Description | |
---|---|---|
AddRule | Adds the rule to the set of associated rules. | |
DeleteRule | Deletes the rule from the set of associated rules. | |
Rules | The rules associated with the class. | |
RulesByField | The rules associated with the attribute. | |
RulesBySubtypeCode | The rules associated with the subtype. | |
Validate | Validates the selection. | |
ValidateSelection | Validates the selection. | |
ValidateSet | Validates the set. |
IValidation.AddRule Method
Adds the rule to the set of associated rules.
Public Sub AddRule ( _
ByVal Rule As IRule _
)
public void AddRule (
IRule Rule
);
Description
This method is deprecated. Use a rule-specific method to add rules (i.e. IClassSchemaEdit.AlterDomain for attribute rules, IGeometricNetwork.AddRule for connectivity rules, IRelationshipClass.AddRelationshipRule for relationship rules).
IValidation.DeleteRule Method
Deletes the rule from the set of associated rules.
Public Sub DeleteRule ( _
ByVal Rule As IRule _
)
public void DeleteRule (
IRule Rule
);
Description
This method is deprecated. Use a rule-specific method to delete rules (i.e. IClassSchemaEdit.AlterDomain for attribute rules, IGeometricNetwork.DeleteRule for connectivity rules, IRelationshipClass.DeleteRelationshipRule for relationship rules).
IValidation.Rules Property
The rules associated with the class.
Public ReadOnly Property Rules As IEnumRule
public IEnumRule Rules {get;}
Description
Rules is a property that returns a IEnumRule object that contains all of the rules associated with the object class.
Remarks
Property Rulesreturns a IEnumRule enumerator hydrated with all of the rules associated with the object class.
IValidation.RulesByField Property
The rules associated with the attribute.
Public Function get_RulesByField ( _
ByVal FieldName As String _
) As IEnumRule
public IEnumRule get_RulesByField (
string FieldName
);
Description
RulesByField is a property that returns a IEnumRule object that contains all of the rules associated with the FieldName parameter passed to this property for the given object class.
IValidation.RulesBySubtypeCode Property
The rules associated with the subtype.
Public Function get_RulesBySubtypeCode ( _
ByVal SubtypeCode As Integer _
) As IEnumRule
public IEnumRule get_RulesBySubtypeCode (
int SubtypeCode
);
Description
RulesBySubtypeCode returns a IEnumRule object that contains all of the rules associated with the SubtypeCode passed into this property for the given object class.
IValidation.Validate Method
Validates the selection.
Public Function Validate ( _
ByVal Selection As IQueryFilter, _
ByVal Workspace As IWorkspace _
) As ISelectionSet
public ISelectionSet Validate (
IQueryFilter Selection,
IWorkspace Workspace
);
Description
This method creates a selection set that contains the underlying class' invalid objects.
A query filter can be provided to validate a portion of the class' objects, but passing a null value will evaluate all of the class' objects.
The Workspace parameter indicates where the selection set is to be created. In most cases, a null value can be used, indicating that the class' workspace be used. If necessary, a scratch workspace may also be used.
Remarks
Validate on a row occurs in five steps:
-
Validate the subtype
-
Validate the attribute rules
-
Validate the network connectivity rules (if network feature)
-
Validate the relationship rules
-
Perform custom validation (using optional class extension)
The validate process stops once a row is found invalid. For example, if a network feature violates an attribute rule, the validation process stops and the feature's network connectivity rules are not evaluated until the attribute rule violation is corrected.
IValidation.ValidateSelection Method
Validates the selection.
Public Function ValidateSelection ( _
ByVal Selection As ISelectionSet, _
ByVal Workspace As IWorkspace _
) As ISelectionSet
public ISelectionSet ValidateSelection (
ISelectionSet Selection,
IWorkspace Workspace
);
Description
This method creates a selection set that contains the underlying class' invalid objects.
A selection set must be passed to the first parameter, indicating that a subset of the class' objects should be evaluated. Unlike the query filter parameter of the Validate method, this parameter requires a valid selection set, and passing a null value will cause the method to fail.
The Workspace parameter indicates where the selection set is to be created. In most cases, a null value can be used, indicating that the class' workspace be used. If necessary, a scratch workspace may also be used.
IValidation.ValidateSet Method
Validates the set.
Public Function ValidateSet ( _
ByVal Selection As ISet _
) As ISet
public ISet ValidateSet (
ISet Selection
);
Description
ValidateSet function takes the ISet parameter and validates that set based on the rules associated with the object class. It returns a ISet object containing all of the invalid features that it found in that set.
Classes that implement IValidation
Classes | Description |
---|---|
FeatureClass | Esri Feature Class object. |
ObjectClass | Esri Object Class object. |
ObjectClassValidator | Esri ObjectClassValidator object. |