Exemple #1
0
        /// <summary>
        /// ChangeRule: typeof(ValueConstraintShape), FireTime=TopLevelCommit, Priority=DiagramFixupConstants.ResizeParentRulePriority;
        /// </summary>
        private static void ValueConstraintShapeDisplayChangedRule(ElementPropertyChangedEventArgs e)
        {
            Guid propertyId = e.DomainProperty.Id;

            if (propertyId == ValueConstraintShape.MaximumDisplayedValuesDomainPropertyId || propertyId == ValueConstraintShape.MaximumDisplayedColumnsDomainPropertyId)
            {
                ValueConstraintShape valueConstraintShape = (ValueConstraintShape)e.ModelElement;
                if (!valueConstraintShape.IsDeleted)
                {
                    valueConstraintShape.InvalidateDisplayText();
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// ChangeRule: typeof(ValueConstraint), FireTime=TopLevelCommit, Priority=DiagramFixupConstants.ResizeParentRulePriority;
 /// Rule to watch the ValueConstraint.TextChanged property so that we can
 /// update text as needed. TextChanged is triggered when the ValueConstraint is
 /// first added, so this is sufficient for updating.
 /// </summary>
 private static void ValueConstraintTextChangedRule(ElementPropertyChangedEventArgs e)
 {
     if (e.DomainProperty.Id == ValueConstraint.TextChangedDomainPropertyId)
     {
         ValueConstraint constraint = (ValueConstraint)e.ModelElement;
         if (!constraint.IsDeleted)
         {
             foreach (ShapeElement pel in PresentationViewsSubject.GetPresentation(constraint))
             {
                 ValueConstraintShape valueConstraintShape = pel as ValueConstraintShape;
                 if (valueConstraintShape != null)
                 {
                     valueConstraintShape.InvalidateDisplayText();
                 }
             }
         }
     }
 }