Esempio n. 1
0
        /// <summary>
        /// Update the shape with the given style information
        /// </summary>
        /// <param name="shape"></param>
        /// <param name="strokeStyle">Stroke Style Information</param>
        /// <param name="fillStyle">Fill Style Information</param>
        public static void UpdateShape(this Shape shape, StrokeStyle strokeStyle, FillStyle fillStyle)
        {
            if (strokeStyle != null)
            {
                shape.Stroke = strokeStyle.StrokeColor;
                shape.StrokeThickness = strokeStyle.Thickness;
                shape.StrokeStartLineCap = strokeStyle.StartLineCap;
                shape.StrokeEndLineCap = strokeStyle.EndLineCap;
                if (strokeStyle.DashStyle != null)
                {
                    shape.StrokeDashArray = strokeStyle.DashStyle.Dashes;
                    shape.StrokeDashOffset = strokeStyle.DashStyle.Offset;
                    shape.StrokeDashCap = strokeStyle.DashCap;
                }
            }

            if (fillStyle != null)
            {
                shape.Fill = fillStyle.FillColor;
            }
        }
Esempio n. 2
0
 public ShapeStyle(StrokeStyle strokeStyle, FillStyle fillStyle)
 {
     StrokeStyle = strokeStyle;
     FillStyle = fillStyle;
 }
Esempio n. 3
0
 public ShapeStyle(StrokeStyle strokeStyle)
 {
     StrokeStyle = strokeStyle;
 }
Esempio n. 4
0
 public ShapeStyle()
 {
     StrokeStyle = new StrokeStyle();
     FillStyle = new FillStyle();
 }
Esempio n. 5
0
 protected bool Equals(StrokeStyle other)
 {
     return Thickness.Equals(other.Thickness) && Equals(StrokeColor, other.StrokeColor) && Equals(DashStyle, other.DashStyle) && DashCap.Equals(other.DashCap) && StartLineCap.Equals(other.StartLineCap) && EndLineCap.Equals(other.EndLineCap) && LineJoin.Equals(other.LineJoin);
 }
Esempio n. 6
0
 public static void UpdateShape(this Shape shape, StrokeStyle strokeStyle)
 {
     UpdateShape(shape, strokeStyle, null);
 }