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); } } }
public void AddOnUpdateIfNeeded(StringBuilder sb, ConstraintProperty prop) { if (prop.HasOnUpdate()) { sb.Append(" ON UPDATE ").Append(UpdateDeleteValue(prop)); } }
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; }
set => SetValue(ConstraintProperty, value);
public SimplePropertyConstraint(Control control, ConstraintProperty property, double constant) { Control = control; Property = property; Constant = constant; }
public static bool Match(this ConstraintProperty prop, ConstraintProperty compare) { return (prop & compare) == compare; }