public GridVObjectData(GridVObject obj) : base(obj) { C = obj.Cols; R = obj.Rows; SX = obj.StepX; SY = obj.StepY; HLC = obj.HorizontalLineColor; VLC = obj.VerticalLineColor; LW = obj.LineWidth; FLW = obj.FixedLineWidth; }
private void ReadGridAttributes(GridVObject vObject, SvgVoGrid svg) { ReadBaseRectangleVObjectAttributes(vObject, svg); vObject.ControlPoints = new[] { new PointF(svg.X, svg.Y), new PointF(svg.X + svg.Cols * svg.StepX, svg.Y + svg.Rows * svg.StepY) }; vObject.VerticalLineColor = svg.GetVerticalLineColor(_serializer); vObject.HorizontalLineColor = svg.GetHorizontalLineColor(_serializer); vObject.LineWidth = svg.StrokeWidth; vObject.Cols = svg.Cols; vObject.Rows = svg.Rows; vObject.StepX = svg.StepX; vObject.StepY = svg.StepY; vObject.FixedLineWidth = svg.FixedStrokeWidth; }
private void WriteGridAttributes(SvgVoGrid svg, GridVObject vObject) { WriteBaseRectangleVObjectAttributes(svg, vObject); var cm = vObject.GetColorManagement(true); svg.SetVerticalLineColor(vObject.VerticalLineColor, ColorManagement.GetPreviewColor(cm, vObject.VerticalLineColor), _serializer); svg.SetHorizontalLineColor(vObject.HorizontalLineColor, ColorManagement.GetPreviewColor(cm, vObject.HorizontalLineColor), _serializer); svg.StrokeWidth = vObject.LineWidth; svg.Cols = vObject.Cols; svg.Rows = vObject.Rows; svg.StepX = vObject.StepX; svg.StepY = vObject.StepY; var rect = vObject.Rectangle.ToRectangleF(); svg.X = rect.X; svg.Y = rect.Y; svg.FixedStrokeWidth = vObject.FixedLineWidth; }
internal VObject FromSvg(SvgElement svg) { if (svg is SvgVoGrid) { var vObject = new GridVObject(); ReadGridAttributes(vObject, svg as SvgVoGrid); return(vObject); } else if (svg is SvgPolyline) { var vObject = new PolylineVObject(); ReadPolylineAttributes(vObject, svg as SvgPolyline); return(vObject); } else if (svg is SvgVoDashLine) { var vObject = new DashedLineVObject(); ReadDashLineAttributes(vObject, svg as SvgVoDashLine); return(vObject); } else if (svg is SvgLine) { var vObject = new LineVObject(); ReadLineAttributes(vObject, svg as SvgLine); return(vObject); } else if (svg is SvgEllipse) { var vObject = new EllipseVObject(); ReadEllipseAttributes(vObject, svg as SvgEllipse); return(vObject); } else if (svg is SvgVoSvg) { var vObject = new SvgVObject(); ReadSvgAttributes(vObject, svg as SvgVoSvg); return(vObject); } else if (svg is SvgVoImage) { var vObject = new ImageVObject(); ReadImageAttributes(vObject, svg as SvgVoImage); return(vObject); } else if (svg is SvgVoPlainText) { var vObject = new PlainTextVObject(); ReadPlainTextAttributes(vObject, svg as SvgVoPlainText); return(vObject); } else if (svg is SvgVoCurvedText) { var vObject = new CurvedTextVObject(); ReadCurvedTextAttributes(vObject, svg as SvgVoCurvedText); return(vObject); } else if (svg is SvgVoAutoScaledText) { var vObject = new AutoScaledTextVObject(); ReadAutoScaledTextAttributes(vObject, svg as SvgVoAutoScaledText); return(vObject); } else if (svg is SvgVoPathBoundedText) { var vObject = new PathBoundedTextVObject(); ReadPathBoundedTextAttributes(vObject, svg as SvgVoPathBoundedText); return(vObject); } else if (svg is SvgVoBoundedText) { var vObject = new BoundedTextVObject(); ReadBoundedTextAttributes(vObject, svg as SvgVoBoundedText); return(vObject); } else if (svg is SvgVoPlaceholder) { var vObject = new PlaceholderVObject(); ReadPlaceholderAttributes(vObject, (SvgVoPlaceholder)svg); return(vObject); } else if (svg is SvgVoRectangle) { var vObject = new RectangleVObject(); ReadRectangleAttributes(vObject, (SvgVoRectangle)svg); return(vObject); } else if (svg is SvgVoShape) { var vObject = new ShapeVObject(); ReadShapeAttributes(vObject, (SvgVoShape)svg); return(vObject); } else { return(null); } }