private static object ConvertToInstanceDescriptor(SimplePropertyConstraint simplePropertyConstraint)
 {
     if (simplePropertyConstraint.Control == null &&
         simplePropertyConstraint.Property == ConstraintProperty.None)
     {
         var constructorInfo = GetConstructorInfo(typeof(int));
         return(new InstanceDescriptor(constructorInfo, new object[]
         {
             simplePropertyConstraint.Constant
         }));
     }
     else
     {
         var constructorInfo = GetConstructorInfo(typeof(Control), typeof(ConstraintProperty), typeof(int));
         return(new InstanceDescriptor(constructorInfo, new object[]
         {
             simplePropertyConstraint.Control,
             simplePropertyConstraint.Property,
             simplePropertyConstraint.Constant
         }));
     }
 }
Example #2
0
 public void SetBottom(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Bottom = propertyConstraint;
     PerformLayout(this, "BottomConstraint");
 }
Example #3
0
 public void SetRight(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Right = propertyConstraint;
     PerformLayout(this, "RightConstraint");
 }
Example #4
0
 public void SetMiddle(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Middle = propertyConstraint;
     PerformLayout(this, "MiddleConstraint");
 }
Example #5
0
 public void SetCenter(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Center = propertyConstraint;
     PerformLayout(this, "CenterConstraint");
 }
Example #6
0
 public void SetTop(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Top = propertyConstraint;
     PerformLayout(this, "TopConstraint");
 }
Example #7
0
 public void SetWidth(Control child, SimplePropertyConstraint propertyConstraint)
 {
     GetElement(child).Width = propertyConstraint;
     PerformLayout(this, "WidthConstraint");
 }