26 changed files with 541 additions and 257 deletions
@ -1,130 +0,0 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: Peter Forstmeier |
|
||||||
* Date: 03.04.2013 |
|
||||||
* Time: 20:35 |
|
||||||
* |
|
||||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
|
||||||
*/ |
|
||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Drawing; |
|
||||||
|
|
||||||
using ICSharpCode.Reporting.Interfaces; |
|
||||||
using ICSharpCode.Reporting.Interfaces.Export; |
|
||||||
|
|
||||||
namespace ICSharpCode.Reporting.BaseClasses |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Description of Page.
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
|
|
||||||
public class Page:IExportContainer,IPage |
|
||||||
{ |
|
||||||
public Page(IPageInfo pageInfo,Size pageSize) |
|
||||||
{ |
|
||||||
if (pageInfo == null) { |
|
||||||
throw new ArgumentNullException("pageInfo"); |
|
||||||
} |
|
||||||
PageInfo = pageInfo; |
|
||||||
Name = "Page"; |
|
||||||
Size = pageSize; |
|
||||||
exportedItems = new List<IExportColumn>(); |
|
||||||
} |
|
||||||
|
|
||||||
public bool IsFirstPage {get;set;} |
|
||||||
|
|
||||||
|
|
||||||
public IPageInfo PageInfo {get;private set;} |
|
||||||
|
|
||||||
|
|
||||||
public string Name {get;set;} |
|
||||||
|
|
||||||
|
|
||||||
public System.Drawing.Size Size {get;set;} |
|
||||||
|
|
||||||
|
|
||||||
public System.Drawing.Point Location {get;set;} |
|
||||||
|
|
||||||
|
|
||||||
public List<IExportColumn> exportedItems; |
|
||||||
|
|
||||||
public List<IExportColumn> ExportedItems { |
|
||||||
get { return exportedItems; } |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
public IExportContainer CreateExportColumn() |
|
||||||
{ |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
|
|
||||||
public ICSharpCode.Reporting.Arrange.IArrangeStrategy GetArrangeStrategy() |
|
||||||
{ |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
|
|
||||||
public Size DesiredSize { |
|
||||||
get { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
set { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public Color ForeColor { |
|
||||||
get { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
set { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public Color BackColor { |
|
||||||
get { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
set { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
public Color FrameColor { |
|
||||||
get { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
set { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
public IExportColumn Parent { |
|
||||||
get { |
|
||||||
return null; |
|
||||||
} |
|
||||||
set { |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public bool CanGrow {get;set;} |
|
||||||
|
|
||||||
public bool CanShrink {get;set;} |
|
||||||
|
|
||||||
public Rectangle DisplayRectangle { |
|
||||||
get { |
|
||||||
return new Rectangle(Location,Size); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public ICSharpCode.Reporting.Arrange.IMeasurementStrategy MeasurementStrategy() |
|
||||||
{ |
|
||||||
throw new NotImplementedException(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -0,0 +1,40 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||||
|
using System; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Exporter.Visitors |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of CanvasExtension.
|
||||||
|
/// http://denisvuyka.wordpress.com/2007/12/15/wpf-simplify-your-life-with-linq-extension-methods-canvas-and-visual-tree-helpers/
|
||||||
|
/// </summary>
|
||||||
|
public static class CanvasExtension |
||||||
|
{ |
||||||
|
|
||||||
|
public static void AddChild<T>(this Canvas canvas, T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement != null && !canvas.Children.Contains(uiElement)) |
||||||
|
canvas.Children.Add(uiElement); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static void RemoveChild<T>(this Canvas canvas, T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement != null && canvas.Children.Contains(uiElement)) |
||||||
|
canvas.Children.Remove(uiElement); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static void InsertChild<T>(this Canvas canvas, int index, T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement != null && !canvas.Children.Contains(uiElement)) |
||||||
|
canvas.Children.Insert(index, uiElement); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,69 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||||
|
using System; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
|
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Exporter.Visitors |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of CanvasHelper.
|
||||||
|
/// http://denisvuyka.wordpress.com/2007/12/15/wpf-simplify-your-life-with-linq-extension-methods-canvas-and-visual-tree-helpers/
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
internal static class CanvasHelper |
||||||
|
{ |
||||||
|
public static double GetLeft<T>(T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
return (double)uiElement.GetValue(Canvas.LeftProperty); |
||||||
|
} |
||||||
|
|
||||||
|
public static double GetTop<T>(T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
return (double)uiElement.GetValue(Canvas.TopProperty); |
||||||
|
} |
||||||
|
|
||||||
|
public static Point GetPosition<T>(T element) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
|
||||||
|
return new Point( |
||||||
|
(double)uiElement.GetValue(Canvas.LeftProperty), |
||||||
|
(double)uiElement.GetValue(Canvas.TopProperty)); |
||||||
|
} |
||||||
|
|
||||||
|
public static void SetLeft<T>(T element, double length) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
uiElement.SetValue(Canvas.LeftProperty, length); |
||||||
|
} |
||||||
|
|
||||||
|
public static void SetTop<T>(T element, double length) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
uiElement.SetValue(Canvas.TopProperty, length); |
||||||
|
} |
||||||
|
|
||||||
|
public static void SetPosition<T>(T element, Point value) |
||||||
|
{ |
||||||
|
UIElement uiElement = element as UIElement; |
||||||
|
if (uiElement == null) |
||||||
|
throw new ArgumentNullException("element"); |
||||||
|
uiElement.SetValue(Canvas.LeftProperty, value.X); |
||||||
|
uiElement.SetValue(Canvas.TopProperty, value.Y); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,57 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 03.04.2013 |
||||||
|
* Time: 20:35 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Drawing; |
||||||
|
|
||||||
|
using ICSharpCode.Reporting.Exporter.Visitors; |
||||||
|
using ICSharpCode.Reporting.Interfaces.Export; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.PageBuilder.ExportColumns |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of Page.
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
|
||||||
|
public class ExportPage:ExportColumn,IPage,IAcceptor |
||||||
|
{ |
||||||
|
public ExportPage(IPageInfo pageInfo,Size pageSize):base() |
||||||
|
{ |
||||||
|
if (pageInfo == null) { |
||||||
|
throw new ArgumentNullException("pageInfo"); |
||||||
|
} |
||||||
|
PageInfo = pageInfo; |
||||||
|
Name = "Page"; |
||||||
|
Size = pageSize; |
||||||
|
exportedItems = new List<IExportColumn>(); |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsFirstPage {get;set;} |
||||||
|
|
||||||
|
|
||||||
|
public IPageInfo PageInfo {get;private set;} |
||||||
|
|
||||||
|
|
||||||
|
public bool CanShrink {get;set;} |
||||||
|
|
||||||
|
|
||||||
|
public void Accept(IVisitor visitor) |
||||||
|
{ |
||||||
|
visitor.Visit(this as ExportPage); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
List<IExportColumn> exportedItems; |
||||||
|
|
||||||
|
public List<IExportColumn> ExportedItems { |
||||||
|
get { return exportedItems; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue