public void ExportColumnIsNotNull() { BaseTextItem bt = new BaseTextItem(); BaseExportColumn bec = bt.CreateExportColumn(); Assert.IsNotNull(bec); }
public void ExportColumnIsNotNull() { BaseRowItem bri = new BaseRowItem(); BaseExportColumn bec = bri.CreateExportColumn(); Assert.IsNotNull(bec); }
public void Convert_SimpleItems_Should_Calculate_Correct_Locations() { ReportItemCollection ri = new ReportItemCollection(); Point itemLocation = new Point(10, 10); BaseReportItem r = new BaseTextItem() { Location = itemLocation, Size = new Size(20, 100) }; ri.Add(r); Point offset = new Point(20, 20); Rectangle parentRectangle = new Rectangle(50, 50, 700, 50); Sut.ParentRectangle = parentRectangle; ExporterCollection ec = Sut.ConvertSimpleItems(offset, ri); BaseExportColumn be = ec[0]; // this.ParentRectangle.Location.X + lineItem.StyleDecorator.Location.X, // lineItem.StyleDecorator.Location.Y + offset.Y); Point resultLocation = new Point(parentRectangle.Location.X + itemLocation.X, itemLocation.Y + offset.Y); Assert.AreEqual(resultLocation, be.StyleDecorator.Location); }
UIElement ItemFactory(BaseExportColumn column) { UIElement element = null; System.Windows.Controls.Border border = null; var graphicContainer = column as ExportGraphicContainer; if (graphicContainer != null) { element = CreateGraphicsContainer(graphicContainer); return(element); } var container = column as ExportContainer; if (container != null) { element = CreateContainer(container); } var exportGraphic = column as ExportGraphic; if (exportGraphic != null) { element = CreateGraphicsElement(exportGraphic); } var text = column as ExportText; if (text != null) { var t = CreateTextBlock(text); if (column.StyleDecorator.DrawBorder) { border = CreateBorder(column.StyleDecorator as BaseStyleDecorator, GlobalValues.DefaultBorderThickness, GlobalValues.DefaultCornerRadius); border.Child = t; element = border; } else { element = t; } } var image = column as ExportImage; if (image != null) { element = CreateImageColumn(image); } return(element); }
public void TypeofExportShouldBeExportText() { BaseTextItem bt = new BaseTextItem(); BaseExportColumn bec = bt.CreateExportColumn(); Type t = typeof(ExportText); Assert.AreEqual(t, bec.GetType(), "Type should be 'ExportText"); }
public void TypeofExportShouldBeExportContainer() { BaseRowItem bri = new BaseRowItem(); BaseExportColumn bec = bri.CreateExportColumn(); Type t = typeof(ExportContainer); Assert.AreEqual(t, bec.GetType(), "Type should be 'ExportContainer"); }
/// <summary> /// Convert a single item, Location is calculated as follows /// </summary> /// <param name="offset"> only Y value is used, gives the offset to Items location.Y </param> /// <param name="item">Item to convert</param> /// <returns></returns> public static BaseExportColumn ConvertLineItem(BaseReportItem item, Point offset) { if (item == null) { throw new ArgumentNullException("item"); } IExportColumnBuilder columnBuilder = item as IExportColumnBuilder; BaseExportColumn lineItem = null; if (columnBuilder != null) { lineItem = columnBuilder.CreateExportColumn(); lineItem.StyleDecorator.Location = new Point(offset.X + lineItem.StyleDecorator.Location.X, lineItem.StyleDecorator.Location.Y + offset.Y); lineItem.StyleDecorator.DisplayRectangle = new Rectangle(lineItem.StyleDecorator.Location, lineItem.StyleDecorator.Size); } return(lineItem); }