Indicates if the topology rule can be added to the topology.
[Visual Basic .NET] Public Function get_CanAddRule ( _ ByVal Rule As ITopologyRule _ ) As Boolean
[C#] public bool get_CanAddRule ( ITopologyRule Rule );
[C++] HRESULT get_CanAddRule( ITopologyRule* Rule, VARIANT_BOOL* CanAddRule );
Rule is a parameter of type ITopologyRuleCanAddRule [out, retval] CanAddRule is a parameter of type VARIANT_BOOL
The CanAddRule property returns a Boolean value indicating if the topology rule is valid and consistent with respect to the existing rules. This property will return false if:
- An identical rule is already present in the Topology. A rule is determined to be identical with an existing rule if:
- For a given rule type, the origin class and subtype and if applicable, destination class and subtype are equal to an existing rule.
- For single feature class rules, such as esriTRTAreaNoGaps in the origin feature class is defined at the class and subtype level.
- The destination feature class is specified at both the class and subtype level if the origin is specified at the class level.
- the origin subtype is defined twice, except for rules esriTRTAreaNoOverlapArea and esriTRTLineNoOverlapLine.
- A topology rule of the same rule type with the same origin and destination feature class is already present in the Topology, but the rule being added is defined at the subtype level.
- The rule is defined on both the subtype and class levels for a given class - rule combination.
- The Object Class ID and Subtype value are invalid. For example, if the topology rule has been specified to use subtypes however no subtypes are defined for the relevant feature class, CanAddRule would return false.
For example, for feature class FC1 with subtypes; SubT1 and SubT2, and a Topology with the rule; FC1 AreaNoOverlap, the following rules, specified at the subtype level, are invalid and CanAddRule would return false:
FC1: SubT1 AreNoOverlap
FC1: SubT2 AreNoOverlap
After calling CanAddRule, it is not guaranteed that the topology rule will be added to the Topology. AddRule may still fail if the geometry types of the Origin and Destination feature classes are incorrect. In this case, an FDO_E_INVALID_GEOMETRY_TYPE_FOR_TOPOLOGY_RULE error would be raised.