public virtual void Visit (ExportContainer exportContainer) { foreach (var element in exportContainer.ExportedItems) { var ac = element as IAcceptor; ac.Accept(this); } }
public override void Visit(ExportContainer exportContainer){ sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer); sectionCanvas.Name = exportContainer.Name; CanvasHelper.SetPosition(sectionCanvas,new Point(exportContainer.Location.X,exportContainer.Location.Y)); PerformList(sectionCanvas,exportContainer.ExportedItems); }
public void ContainerNoChildren() { var param = new ExportContainer(); var size = param.Size; strategy.Arrange(param); Assert.That(param.Size, Is.EqualTo(size)); }
public static Canvas CreateContainer(ExportContainer container) { var canvas = CreateCanvas(container); var size = container.DesiredSize.ToWpf(); canvas.Measure(size); canvas.Arrange(new Rect(new Point(),size )); canvas.UpdateLayout(); return canvas; }
ExportText Evaluate(string script) { collection[0].Text = script; var exportContainer = new ExportContainer(); exportContainer.ExportedItems.Add(collection[0]); expressionVisitor.Visit(exportContainer); var resultColumn = (ExportText)exportContainer.ExportedItems[0]; return resultColumn; }
public static Canvas CreateContainer(ExportContainer container) { var canvas = CreateCanvas(container); var size = container.DesiredSize.ToWpf(); CanvasHelper.SetPosition(canvas,new Point(container.Location.X,container.Location.Y)); canvas.Measure(size); canvas.Arrange(new Rect(new Point(),size )); canvas.UpdateLayout(); return canvas; }
public static void AddCurrentContainer (this ReportingExpressionEvaluator app,ExportContainer container){ if (container == null) throw new ArgumentNullException("container"); if (!app.Globals.ContainsKey("CurrentContainer")) { app.Globals.Add("CurrentContainer",container); } else { app.Globals["CurrentContainer"] = container; } }
public override void Visit(ExportContainer exportContainer) { foreach (var element in exportContainer.ExportedItems) { var te = element as ExportText; if (te != null) { Visit(te); } } }
Canvas RenderSectionContainer (ExportContainer container) { var canvas = FixedDocumentCreator.CreateContainer(container); foreach (var element in container.ExportedItems) { if (IsContainer(element)) { RenderRow(canvas, (IExportContainer)element); } else { AsAcceptor(element).Accept(this); canvas.Children.Add(UIElement); } } canvas.Background = FixedDocumentCreator.ConvertBrush(container.BackColor); return canvas; }
public override void Visit(ExportContainer exportContainer){ foreach (var element in exportContainer.ExportedItems) { if (IsContainer(element)) { var container = element as ExportContainer; containerLocation = PdfHelper.LocationRelToParent(container); RenderRow(container); } else { containerLocation = PdfHelper.LocationRelToParent(exportContainer); var acceptor = element as IAcceptor; acceptor.Accept(this); } } }
public override IExportColumn CreateExportColumn() { var export = new ExportContainer(); export.ToExportItem(this); return export; // return new ExportContainer(){ // Name = this.Name, // Size = this.Size, // Location = this.Location, // CanGrow = this.CanGrow, // BackColor = this.BackColor, // DesiredSize = this.Size // }; }
public override void Visit(ExportContainer exportContainer) { foreach (var element in exportContainer.ExportedItems) { var container = element as ExportContainer; if (container != null) { containerLocation = PdfHelper.LocationRelToParent(container); var r = new Rectangle(containerLocation,container.DisplayRectangle.Size); PdfHelper.FillRectangle(r,container.BackColor,gfx); Visit(container); } containerLocation = PdfHelper.LocationRelToParent(exportContainer); var ac = element as IAcceptor; ac.Accept(this); } }
public void SumAllGroups () { var container = new ExportContainer(); container.ExportedItems.AddRange(collection); var visitor = new ExpressionVisitor (reportSettings); visitor.SetCurrentDataSource(dataSource.GroupedList); foreach (var group in dataSource.GroupedList) { var script = "= sum('randomint')"; collection[0].Text = script; visitor.SetCurrentDataSource(group); visitor.Visit(container); var result = list.Where(k => k.GroupItem == group.Key.ToString()).Sum(x => x.RandomInt); Assert.That(Convert.ToDouble(collection[0].Text),Is.EqualTo(result)); } }
public void FieldNotExist() { var script = "=Fields!myfieldNotExist"; collection[0].Text = script; collection.Add(new ExportText() { Text = "Sharpdevelop", Name = "myfield1" }); var exportContainer = new ExportContainer(); exportContainer.ExportedItems.Add(collection[0]); exportContainer.ExportedItems.Add(collection[1]); visitor.Visit(exportContainer); Assert.That (collection[0].Text.StartsWith("Missing")); Assert.That (collection[0].Text.Contains("myfieldNotExist")); }
public UIElement CreateContainer(ExportContainer container) { // http://tech.pro/tutorial/736/wpf-tutorial-creating-a-custom-panel-control var canvas = CreateCanvas(container); // canvas.Measure(new Size(reportSettings.PageSize.Width,reportSettings.PageSize.Height)); var size = new Size(container.DesiredSize.Width,container.DesiredSize.Height); canvas.Measure(size); // canvas.Arrange(new Rect(new System.Windows.Point(),new Size(reportSettings.PageSize.Width,reportSettings.PageSize.Height) )); canvas.Arrange(new Rect(new System.Windows.Point(),size )); canvas.UpdateLayout(); return canvas; }
public void SimpleStringHandlingInContainer() { var script = "='Sharpdevelop' + ' is great'"; collection[0].Text = script; var exportContainer = new ExportContainer(); exportContainer.ExportedItems.Add(collection[0]); expressionVisitor.Visit(exportContainer); var resultColumn = (ExportText)exportContainer.ExportedItems[0]; Assert.That(resultColumn.Text,Is.EqualTo("Sharpdevelop is great")); }
Canvas RenderDataRow (ExportContainer row) { var rowCanvas = FixedDocumentCreator.CreateContainer(row); var childCanvas = CreateItemsInContainer(row.ExportedItems); rowCanvas.Children.Add(childCanvas); return rowCanvas; }
void DrawRectangleAsContainer(ExportContainer container) { var rect = container as ExportRectangle; if (rect != null) { Visit(rect); } }
public override void Visit(ExportContainer exportContainer){ sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer); sectionCanvas = RenderSectionContainer(exportContainer); }
public override void Visit(ExportContainer exportContainer) { evaluator.AddCurrentContainer(exportContainer); base.Visit(exportContainer); }
public override void Visit(ExportContainer exportColumn) { // Console.WriteLine("Wpf-Visit ExportContainer {0} - {1} - {2}", exportColumn.Name,exportColumn.Size,exportColumn.Location); var canvas = documentCreator.CreateContainer(exportColumn); UIElement = canvas; }
List<IExportColumn> FillAndConvert(ExportContainer parent, object current, List<IPrintableObject> dataItems, IContainerConverter converter) { DataSource.Fill(dataItems, current); var convertedItems = converter.CreateConvertedList(dataItems.ToList()); converter.SetParent(parent, convertedItems); return convertedItems; }
void EvaluateExpressionsInGroups(ExportContainer sectionContainer, IGrouping<object, object> grouping){ ExpressionRunner.Visitor.SetCurrentDataSource(grouping); ExpressionRunner.Visitor.Visit(sectionContainer); }
public override void Visit(ExportContainer exportContainer) { base.Visit(exportContainer); }
Canvas CreateCanvas(ExportContainer container) { var canvas = new Canvas(); SetDimension(canvas, container); SetPosition(canvas,container); canvas.Background = ConvertBrush(System.Drawing.Color.Red); return canvas; }
public abstract void Visit(ExportContainer exportColumn);
IExportContainer CreateContainer() { var container = new ExportContainer(){ Size = new Size (720,60), Location = new Point(50,50), Name ="Section" }; var item1 = new ExportText(){ Name = "Item1", Location = new Point(10,10), Size = new Size (60,20), Parent = container }; container.ExportedItems.Add(item1); return container; }
void InsertContainer(ExportContainer sectionContainer){ if (Pages.Count == 0) { CurrentPage.ExportedItems.Insert(2, sectionContainer); } else { CurrentPage.ExportedItems.Insert(1, sectionContainer); } }
static Canvas CreateCanvas(ExportContainer container) { var canvas = new Canvas(); SetPositionAndSize(canvas,container); canvas.Name = container.Name; canvas.Background = ConvertBrush(container.BackColor); return canvas; }
public void FieldsInContainer() { var script = "=Fields!myfield1 + Fields!myfield2"; collection[0].Text = script; collection.Add(new ExportText() { Text = "Sharpdevelop", Name = "myfield1" }); collection.Add(new ExportText() { Text = " is great", Name = "myfield2" }); var exportContainer = new ExportContainer(); exportContainer.ExportedItems.Add(collection[0]); exportContainer.ExportedItems.Add(collection[1]); exportContainer.ExportedItems.Add(collection[2]); visitor.Visit(exportContainer); Assert.That (collection[0].Text,Is.EqualTo("Sharpdevelop is great")); }