Example #1
0
        public static bool ApplyLineStyle(DrawingCanvas drawingCanvas, LineStyleType value, bool addToHistory)
        {
            CommandChangeState command = new CommandChangeState(drawingCanvas);
            bool wasChange             = false;


            // LineStyle is set for all objects except of GraphicsText.
            // Though GraphicsText has this property, it should remain constant.

            foreach (GraphicsBase g in drawingCanvas.Selection)
            {
                if (g is GraphicsRectangle ||
                    g is GraphicsEllipse ||
                    g is GraphicsLine ||
                    g is GraphicsPolyLine)
                {
                    if (g.LineStyle != value)
                    {
                        g.LineStyle = value;
                        wasChange   = true;
                    }
                }
            }

            if (wasChange && addToHistory)
            {
                command.NewState(drawingCanvas);
                drawingCanvas.AddCommandToHistory(command);
            }

            return(wasChange);
        }
Example #2
0
        // Called from constructors
        void Fill(Point[] points, double lineWidth, LineStyleType lineStyle, Color objectColor, double actualScale)
        {
            MakeGeometryFromPoints(ref points);

            this.graphicsLineWidth   = lineWidth;
            this.graphicsLineStyle   = lineStyle;
            this.graphicsObjectColor = objectColor;
            this.graphicsActualScale = actualScale;
        }
Example #3
0
 public GraphicsLine(Point start, Point end, double lineWidth, LineStyleType lineStyle, Color objectColor, double actualScale)
 {
     this.lineStart           = start;
     this.lineEnd             = end;
     this.graphicsLineWidth   = lineWidth;
     this.graphicsLineStyle   = lineStyle;
     this.graphicsObjectColor = objectColor;
     this.graphicsActualScale = actualScale;
 }
 public GraphicsRectangle(double left, double top, double right, double bottom,
                          double lineWidth, LineStyleType lineStyle, Color objectColor, double actualScale)
 {
     this.rectangleLeft       = left;
     this.rectangleTop        = top;
     this.rectangleRight      = right;
     this.rectangleBottom     = bottom;
     this.graphicsLineWidth   = lineWidth;
     this.graphicsLineStyle   = lineStyle;
     this.graphicsObjectColor = objectColor;
     this.graphicsActualScale = actualScale;
 }
Example #5
0
        public PropertiesGraphicsLine(GraphicsLine line)
        {
            if (line == null)
            {
                throw new ArgumentNullException("line");
            }

            start       = line.Start;
            end         = line.End;
            lineWidth   = line.LineWidth;
            lineStyle   = line.LineStyle;
            objectColor = line.ObjectColor;
            actualScale = line.ActualScale;
            ID          = line.Id;
            selected    = line.IsSelected;
        }
Example #6
0
        public PropertiesGraphicsPolyLine(GraphicsPolyLine polyLine)
        {
            if (polyLine == null)
            {
                throw new ArgumentNullException("polyLine");
            }


            points      = polyLine.GetPoints();
            lineWidth   = polyLine.LineWidth;
            lineStyle   = polyLine.LineStyle;
            objectColor = polyLine.ObjectColor;
            actualScale = polyLine.ActualScale;
            ID          = polyLine.Id;
            selected    = polyLine.IsSelected;
        }
        public PropertiesGraphicsRectangle(GraphicsRectangle rectangle)
        {
            if (rectangle == null)
            {
                throw new ArgumentNullException("rectangle");
            }

            left   = rectangle.Left;
            top    = rectangle.Top;
            right  = rectangle.Right;
            bottom = rectangle.Bottom;

            lineWidth   = rectangle.LineWidth;
            lineStyle   = rectangle.LineStyle;
            objectColor = rectangle.ObjectColor;
            actualScale = rectangle.ActualScale;
            ID          = rectangle.Id;
            selected    = rectangle.IsSelected;
        }
        public PropertiesGraphicsEllipse(GraphicsEllipse ellipse)
        {
            if (ellipse == null)
            {
                throw new ArgumentNullException("ellipse");
            }

            left   = ellipse.Left;
            top    = ellipse.Top;
            right  = ellipse.Right;
            bottom = ellipse.Bottom;

            lineWidth   = ellipse.LineWidth;
            lineStyle   = ellipse.LineStyle;
            objectColor = ellipse.ObjectColor;
            actualScale = ellipse.ActualScale;
            ID          = ellipse.Id;
            selected    = ellipse.IsSelected;
        }
Example #9
0
 public LineStyle Type(LineStyleType type)
 {
     this.type = type;
     return(this);
 }
Example #10
0
 public T BorderType(LineStyleType borderType)
 {
     this.borderType = borderType;
     return(this as T);
 }
Example #11
0
        public GraphicsPolyLine(Point[] points, double lineWidth, LineStyleType lineStyle, Color objectColor, double actualScale)
        {
            Fill(points, lineWidth, lineStyle, objectColor, actualScale);

            //RefreshDrawng();
        }