Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit acd5d10

Browse files
Render mixed Containers
1 parent 3e8a03a commit acd5d10

3 files changed

Lines changed: 53 additions & 26 deletions

File tree

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ContainerDesigner.cs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@
1414
using System.Windows.Forms.Design;
1515
using ICSharpCode.Reporting.Addin.TypeProvider;
1616

17-
namespace ICSharpCode.Reporting.Addin.Designer
18-
{
17+
namespace ICSharpCode.Reporting.Addin.Designer{
18+
1919
/// <summary>
2020
/// Description of RectangleDesigner.
2121
/// </summary>
22-
public class ContainerDesigner:ParentControlDesigner
23-
{
22+
public class ContainerDesigner:ParentControlDesigner{
23+
2424
ISelectionService selectionService;
2525
IComponentChangeService componentChangeService;
2626

2727

28-
public override void Initialize(IComponent component)
29-
{
28+
public override void Initialize(IComponent component){
3029
if (component == null) {
3130
throw new ArgumentNullException("component");
3231
}
@@ -35,24 +34,34 @@ public override void Initialize(IComponent component)
3534
}
3635

3736

38-
protected override void PostFilterProperties(System.Collections.IDictionary properties)
39-
{
37+
protected override void PostFilterProperties(System.Collections.IDictionary properties){
4038
TypeProviderHelper.RemoveProperties(properties);
4139
base.PostFilterProperties(properties);
4240
}
4341

44-
4542

46-
protected override void OnDragDrop(DragEventArgs de)
47-
{
43+
protected override void OnDragDrop(DragEventArgs de){
4844
base.OnDragDrop(de);
4945
var toolboxService = (IToolboxService)this.GetService(typeof(IToolboxService));
5046
toolboxService.SetSelectedToolboxItem(null);
5147
}
5248

49+
// public override bool CanBeParentedTo(IDesigner parentDesigner)
50+
// {
51+
// base.CanBeParentedTo(parentDesigner);
52+
// }
53+
54+
public override bool CanParent(Control control)
55+
{
56+
return base.CanParent(control);
57+
}
5358

54-
void OnSelectionChanged(object sender, EventArgs e)
59+
public override bool CanParent(ControlDesigner controlDesigner)
5560
{
61+
return base.CanParent(controlDesigner);
62+
}
63+
64+
void OnSelectionChanged(object sender, EventArgs e){
5665
Control.Invalidate( );
5766
}
5867

@@ -65,25 +74,25 @@ void OnComponentRename(object sender,ComponentRenameEventArgs e) {
6574
}
6675

6776

68-
void GetService ()
69-
{
77+
void GetService (){
7078
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
7179
if (selectionService != null)
7280
{
7381
selectionService.SelectionChanged += OnSelectionChanged;
7482
}
7583

7684
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
77-
if (componentChangeService != null)
78-
{
85+
if (componentChangeService != null) {
7986
componentChangeService.ComponentRename += OnComponentRename;
87+
componentChangeService.ComponentAdding += (sender, e) => {
88+
89+
};
8090
}
8191
}
8292

8393

8494
#region Dispose
85-
protected override void Dispose(bool disposing)
86-
{
95+
protected override void Dispose(bool disposing){
8796
if (selectionService != null) {
8897
selectionService.SelectionChanged -= OnSelectionChanged;
8998
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,25 @@
4343
</PropertyGroup>
4444
<ItemGroup>
4545
<Reference Include="Irony">
46-
<HintPath>..\Libraries\Irony.dll</HintPath>
46+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\Irony.0.9.0\lib\net45\Irony.dll</HintPath>
4747
</Reference>
4848
<Reference Include="Irony.Interpreter">
49-
<HintPath>..\Libraries\Irony.Interpreter.dll</HintPath>
49+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\Irony.Interpreter.0.9.0\lib\net45\Irony.Interpreter.dll</HintPath>
5050
</Reference>
51-
<Reference Include="PdfSharp">
52-
<HintPath>..\Libraries\PdfSharp.dll</HintPath>
51+
<Reference Include="MigraDoc.DocumentObjectModel-WPF">
52+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\PDFsharp-MigraDoc-WPF.1.32.2608.0\lib\net20\MigraDoc.DocumentObjectModel-WPF.dll</HintPath>
53+
</Reference>
54+
<Reference Include="MigraDoc.Rendering-WPF">
55+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\PDFsharp-MigraDoc-WPF.1.32.2608.0\lib\net20\MigraDoc.Rendering-WPF.dll</HintPath>
56+
</Reference>
57+
<Reference Include="MigraDoc.RtfRendering-WPF">
58+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\PDFsharp-MigraDoc-WPF.1.32.2608.0\lib\net20\MigraDoc.RtfRendering-WPF.dll</HintPath>
59+
</Reference>
60+
<Reference Include="PdfSharp-WPF">
61+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\PDFsharp-MigraDoc-WPF.1.32.2608.0\lib\net20\PdfSharp-WPF.dll</HintPath>
62+
</Reference>
63+
<Reference Include="PdfSharp.Charting-WPF">
64+
<HintPath>C:\Users\Peter Forstmeier\Documents\SharpDevelop Projects\ReportTest\packages\PDFsharp-MigraDoc-WPF.1.32.2608.0\lib\net20\PdfSharp.Charting-WPF.dll</HintPath>
5365
</Reference>
5466
<Reference Include="PresentationCore">
5567
<RequiredTargetFramework>3.0</RequiredTargetFramework>

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
using ICSharpCode.Reporting.Interfaces.Export;
2929
using ICSharpCode.Reporting.PageBuilder.ExportColumns;
3030
using ICSharpCode.Reporting.WpfReportViewer.Visitor.Graphics;
31-
using System.Windows.Shapes;
3231

3332
namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
3433
{
@@ -65,8 +64,9 @@ Canvas RenderSectionContainer (ExportContainer container) {
6564
foreach (var element in container.ExportedItems) {
6665
if (IsContainer(element)) {
6766
if (IsGraphicsContainer(element)) {
68-
var graphContainer = RenderGraphicsContainer(element);
69-
canvas.Children.Add(graphContainer);
67+
canvas.Children.Add(RenderGraphicsContainer(element));
68+
} else {
69+
canvas.Children.Add(RenderRow(element));
7070
}
7171
} else {
7272
var acceptor = element as IAcceptor;
@@ -79,9 +79,15 @@ Canvas RenderSectionContainer (ExportContainer container) {
7979
}
8080

8181

82+
Canvas RenderRow (IExportColumn column) {
83+
var row = column as ExportContainer;
84+
var rowCanvas = CreateItemsInContainer(row.ExportedItems);
85+
return rowCanvas;
86+
}
87+
88+
8289
Canvas RenderGraphicsContainer(IExportColumn column)
8390
{
84-
8591
var graphicsContainer = column as GraphicsContainer;
8692
var graphCanvas = FixedDocumentCreator.CreateContainer(graphicsContainer);
8793
CanvasHelper.SetPosition(graphCanvas, column.Location.ToWpf());

0 commit comments

Comments
 (0)