コード例 #1
0
        public Variable this[ConstraintProperty property]
        {
            get
            {
                switch (property)
                {
                case ConstraintProperty.None: goto default;

                case ConstraintProperty.Width: return(Width);

                case ConstraintProperty.Height: return(Height);

                case ConstraintProperty.Left: return(Left);

                case ConstraintProperty.Center: return(Center);

                case ConstraintProperty.Right: return(Right);

                case ConstraintProperty.Top: return(Top);

                case ConstraintProperty.Middle: return(Middle);

                case ConstraintProperty.Bottom: return(Bottom);

                default: return(null);
                }
            }
        }
コード例 #2
0
 public void AddOnUpdateIfNeeded(StringBuilder sb, ConstraintProperty prop)
 {
     if (prop.HasOnUpdate())
     {
         sb.Append(" ON UPDATE ").Append(UpdateDeleteValue(prop));
     }
 }
コード例 #3
0
 public string UpdateDeleteValue(ConstraintProperty prop)
 {
     switch (prop)
     {
         case ConstraintProperty.CascadeOnDelete:
         case ConstraintProperty.CascadeOnUpdate:
             return "CASCADE";
         case ConstraintProperty.NullOnDelete:
         case ConstraintProperty.NullOnUpdate:
             return "SET NULL";
         case ConstraintProperty.DefaultOnDelete:
         case ConstraintProperty.DefaultOnUpdate:
             return "SET DEFAULT";
     }
     return null;
 }
コード例 #4
0
 set => SetValue(ConstraintProperty, value);
コード例 #5
0
 public SimplePropertyConstraint(Control control, ConstraintProperty property, double constant)
 {
     Control  = control;
     Property = property;
     Constant = constant;
 }
コード例 #6
0
 public static bool Match(this ConstraintProperty prop, ConstraintProperty compare)
 {
     return (prop & compare) == compare;
 }