Esempio n. 1
0
        public ConstraintMakerExtendable MakeExtendableWithAttributes(ConstraintAttributes attributes)
        {
            var description = new ConstraintDescription(_item, attributes);

            _descriptions.Add(description);

            return(new ConstraintMakerExtendable(description));
        }
Esempio n. 2
0
 public ConstraintDescription(LayoutConstraintItem item, ConstraintAttributes attributes)
 {
     Item       = item;
     Constant   = 0.0f;
     Priority   = 1000.0f;
     Multiplier = 1.0f;
     Attributes = attributes;
 }
Esempio n. 3
0
        public static IEnumerable <string> GetConstraintPropertyStrings(Type type)
        {
            ConstraintAttributes TypeSpecificConstraintAttribute = (ConstraintAttributes)Attribute.GetCustomAttribute(type, typeof(ConstraintAttributes), false);

            if (TypeSpecificConstraintAttribute != null)
            {
                return(TypeSpecificConstraintAttribute.ColumnNames);
            }

            return(null);
        }
        internal static NSLayoutAttribute[] LayoutAttributes(this ConstraintAttributes @this)
        {
            var attrs = new List <NSLayoutAttribute>();

            if (@this.Contains(ConstraintAttributes.Top))
            {
                attrs.Add(NSLayoutAttribute.Top);
            }

            if (@this.Contains(ConstraintAttributes.Left))
            {
                attrs.Add(NSLayoutAttribute.Left);
            }

            if (@this.Contains(ConstraintAttributes.Right))
            {
                attrs.Add(NSLayoutAttribute.Right);
            }

            if (@this.Contains(ConstraintAttributes.Bottom))
            {
                attrs.Add(NSLayoutAttribute.Bottom);
            }

            if (@this.Contains(ConstraintAttributes.Leading))
            {
                attrs.Add(NSLayoutAttribute.Leading);
            }

            if (@this.Contains(ConstraintAttributes.Trailing))
            {
                attrs.Add(NSLayoutAttribute.Trailing);
            }

            if (@this.Contains(ConstraintAttributes.Width))
            {
                attrs.Add(NSLayoutAttribute.Width);
            }

            if (@this.Contains(ConstraintAttributes.Height))
            {
                attrs.Add(NSLayoutAttribute.Height);
            }

            if (@this.Contains(ConstraintAttributes.CenterX))
            {
                attrs.Add(NSLayoutAttribute.CenterX);
            }

            if (@this.Contains(ConstraintAttributes.CenterY))
            {
                attrs.Add(NSLayoutAttribute.CenterY);
            }

            if (@this.Contains(ConstraintAttributes.LastBaseline))
            {
                attrs.Add(NSLayoutAttribute.LastBaseline);
            }

            if (@this.Contains(ConstraintAttributes.FirstBaseline))
            {
                attrs.Add(NSLayoutAttribute.FirstBaseline);
            }

            if (@this.Contains(ConstraintAttributes.LeftMargin))
            {
                attrs.Add(NSLayoutAttribute.LeftMargin);
            }

            if (@this.Contains(ConstraintAttributes.RightMargin))
            {
                attrs.Add(NSLayoutAttribute.RightMargin);
            }

            if (@this.Contains(ConstraintAttributes.TopMargin))
            {
                attrs.Add(NSLayoutAttribute.TopMargin);
            }

            if (@this.Contains(ConstraintAttributes.BottomMargin))
            {
                attrs.Add(NSLayoutAttribute.BottomMargin);
            }

            if (@this.Contains(ConstraintAttributes.LeadingMargin))
            {
                attrs.Add(NSLayoutAttribute.LeadingMargin);
            }

            if (@this.Contains(ConstraintAttributes.TrailingMargin))
            {
                attrs.Add(NSLayoutAttribute.TrailingMargin);
            }

            if (@this.Contains(ConstraintAttributes.CenterXWithinMargins))
            {
                attrs.Add(NSLayoutAttribute.CenterXWithinMargins);
            }

            if (@this.Contains(ConstraintAttributes.CenterYWithinMargins))
            {
                attrs.Add(NSLayoutAttribute.CenterYWithinMargins);
            }

            return(attrs.ToArray());
        }
 internal static bool Contains(this ConstraintAttributes @this, ConstraintAttributes attribute)
 {
     return((@this & attribute) == attribute);
 }
 internal static bool Equals(this ConstraintAttributes @this, ConstraintAttributes attribute)
 {
     return(@this == attribute);
 }
Esempio n. 7
0
 internal ConstraintItem(object target, ConstraintAttributes attributes)
 {
     Target     = target;
     Attributes = attributes;
 }