示例#1
0
        private void CheckElement(ConstraintContext ctx, IModelElement mel, ISchemaElement schema)
        {
            List <AbstractConstraintProxy> constraints;

            if (_checkConstraints.TryGetValue(schema.Id, out constraints))
            {
                foreach (var constraint in constraints.Where(c => c.Kind == ConstraintKind.Check))
                {
                    if (Session.Current.CancellationToken.IsCancellationRequested)
                    {
                        break;
                    }

                    constraint.ExecuteConstraint(mel, ctx);
                }
            }
            var parentSchema = schema.SuperClass;

            if (parentSchema != null && !parentSchema.IsPrimitive)
            {
                CheckElement(ctx, mel, parentSchema);
            }
        }
示例#2
0
 public abstract void ExecuteConstraint(IModelElement mel, ConstraintContext ctx);
示例#3
0
 public override void ExecuteConstraint(IModelElement mel, ConstraintContext ctx)
 {
     CheckHandler(mel, ctx, Constraint);
 }