Beispiel #1
0
 private ShadowValue(bool inset, Color overlay, Color color, Offset offset, UnitPx blur, UnitPx size)
 {
     this.inset  = inset;
     this.color  = color;
     this.offset = offset;
     this.blur   = blur;
     this.size   = size;
 }
Beispiel #2
0
 public BorderRadiusValue(UnitPx tlh, UnitPx tlv, UnitPx trh, UnitPx trv, UnitPx brh, UnitPx brv, UnitPx blh, UnitPx blv)
 {
     this.tlh = tlh;
     this.tlv = tlv;
     this.trh = trh;
     this.trv = trv;
     this.brh = brh;
     this.brv = brv;
     this.blh = blh;
     this.blv = blv;
 }
Beispiel #3
0
        public Offset(double angle, double distance)
        {
            if (double.IsNaN(angle) || double.IsNaN(distance))
            {
                this.x = 0;
                this.y = 0;
            }
            else
            {
                if (distance < 2.0)
                {
                    angle = Math.Round(angle / 45) * 45;
                }
                angle  = (angle + 180) * Math.PI / 180;
                this.x = +distance *Math.Cos(angle);

                this.y = -distance *Math.Sin(angle);
            }
        }
Beispiel #4
0
        private static string MinimizeGroup(UnitPx tl, UnitPx tr, UnitPx br, UnitPx bl)
        {
            var ret = new Dictionary <string, UnitPx>(4);

            ret.Add("tl", tl);
            ret.Add("tr", tr);
            ret.Add("br", br);
            ret.Add("bl", bl);
            if (bl == tr)
            {
                ret.Remove("bl");
                if (br == tl)
                {
                    ret.Remove("br");
                    if (tr == tl)
                    {
                        ret.Remove("tr");
                    }
                }
            }
            return(string.Join(" ", ret.Values.ConvertAll(x => x.ToString()).ToArray()));
        }
Beispiel #5
0
 public BorderRadiusValue(UnitPx value) : this(value, value, value, value, value, value, value, value)
 {
 }
Beispiel #6
0
 public BorderValue(UnitPx size, Color color)
 {
     this.size  = size;
     this.color = color;
 }
Beispiel #7
0
 public bool Equals(UnitPx value)
 {
     return(object.Equals(value, null) ? false : Math.Abs(this.value - value.value) < E);
 }