Compartir a través de


Rule Class

When overridden in a derived class, compares rules and determines when they are raised.

Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk (in Microsoft.VisualStudio.Modeling.Sdk.dll)

Syntax

Public MustInherit Class Rule _
    Implements IComparable, IComparable(Of Rule)

Dim instance As Rule
public abstract class Rule : IComparable, 
    IComparable<Rule>
public ref class Rule abstract : IComparable, 
    IComparable<Rule^>
public abstract class Rule implements IComparable, IComparable<Rule>

Remarks

When you use a rule with a model, you must define the RuleOnAttribute attribute. This attribute indicates the type of the rule and when the rule should be raised. Rules can be raised immediately, when a local transaction is committed, or when a top-level transaction is committed. Rules occur inside the context of a transaction. Therefore, the rule is raised before the transaction is committed.

Rules can raise other rules.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Rule
    Microsoft.VisualStudio.Modeling.AddRule
    Microsoft.VisualStudio.Modeling.ChangeRule
    Microsoft.VisualStudio.Modeling.MoveRule
    Microsoft.VisualStudio.Modeling.DeleteRule
    Microsoft.VisualStudio.Modeling.DeletingRule
    Microsoft.VisualStudio.Modeling.RolePlayerChangeRule
    Microsoft.VisualStudio.Modeling.RolePlayerPositionChangeRule
    Microsoft.VisualStudio.Modeling.TransactionBeginningRule
    Microsoft.VisualStudio.Modeling.TransactionCommittingRule
    Microsoft.VisualStudio.Modeling.TransactionRollingBackRule

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Rule Members

Microsoft.VisualStudio.Modeling Namespace