17 changed files with 452 additions and 50 deletions
@ -0,0 +1,33 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:18 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.ComponentModel; |
||||||
|
using ICSharpCode.Reporting.Addin.Designer; |
||||||
|
using ICSharpCode.Reporting.Addin.TypeProvider; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.DesignableItems |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseGroupHeader.
|
||||||
|
/// </summary>
|
||||||
|
[Designer(typeof(GroupedRowDesigner))] |
||||||
|
public class BaseGroupHeader:BaseRowItem |
||||||
|
{ |
||||||
|
|
||||||
|
public BaseGroupHeader() |
||||||
|
{ |
||||||
|
TypeDescriptor.AddProvider(new GroupedRowTypeProvider(), typeof(BaseGroupHeader)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Category("Behavior")] |
||||||
|
public bool PageBreakOnGroupChange {get;set;} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,56 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:31 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Drawing; |
||||||
|
using ICSharpCode.Reporting.Globals; |
||||||
|
using ICSharpCode.Reporting.Addin.Designer; |
||||||
|
using ICSharpCode.Reporting.Addin.TypeProvider; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.DesignableItems |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseRowItem.
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
[Designer(typeof(ContainerDesigner))] |
||||||
|
public class BaseRowItem:AbstractItem |
||||||
|
{ |
||||||
|
|
||||||
|
public BaseRowItem():base() |
||||||
|
{ |
||||||
|
var size = new Size((GlobalValues.PreferedSize.Width * 3) + 10, |
||||||
|
GlobalValues.PreferedSize.Height + 10); |
||||||
|
DefaultSize = size; |
||||||
|
Size = size; |
||||||
|
BackColor = Color.White; |
||||||
|
TypeDescriptor.AddProvider(new RowItemTypeProvider(), typeof(BaseRowItem)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||||
|
{ |
||||||
|
base.OnPaint(e); |
||||||
|
Draw(e.Graphics); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override void Draw(Graphics graphics) |
||||||
|
{ |
||||||
|
if (graphics == null) { |
||||||
|
throw new ArgumentNullException("graphics"); |
||||||
|
} |
||||||
|
using (Brush b = new SolidBrush(this.BackColor)){ |
||||||
|
graphics.FillRectangle(b, DrawingRectangle); |
||||||
|
} |
||||||
|
DrawControl(graphics, base.DrawingRectangle); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,83 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:22 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.ComponentModel.Design; |
||||||
|
using ICSharpCode.Reporting.Addin.TypeProvider; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.Designer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of GroupedRowDesigner.
|
||||||
|
/// </summary>
|
||||||
|
public class GroupedRowDesigner:ContainerDesigner |
||||||
|
{ |
||||||
|
ISelectionService selectionService; |
||||||
|
IComponentChangeService componentChangeService; |
||||||
|
|
||||||
|
|
||||||
|
public override void Initialize(IComponent component) |
||||||
|
{ |
||||||
|
base.Initialize(component); |
||||||
|
GetService(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||||
|
{ |
||||||
|
TypeProviderHelper.RemoveProperties(properties); |
||||||
|
base.PostFilterProperties(properties); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void GetService () |
||||||
|
{ |
||||||
|
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||||
|
if (selectionService != null) |
||||||
|
{ |
||||||
|
selectionService.SelectionChanged += OnSelectionChanged; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||||
|
if (componentChangeService != null) { |
||||||
|
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void OnSelectionChanged(object sender, EventArgs e) |
||||||
|
{ |
||||||
|
Control.Invalidate( ); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||||
|
if (e.Component == this.Component) { |
||||||
|
Control.Name = e.NewName; |
||||||
|
Control.Text = e.NewName; |
||||||
|
Control.Invalidate(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing) |
||||||
|
{ |
||||||
|
if (this.selectionService != null) { |
||||||
|
selectionService.SelectionChanged -= OnSelectionChanged; |
||||||
|
} |
||||||
|
|
||||||
|
if (componentChangeService != null) { |
||||||
|
componentChangeService.ComponentRename -= OnComponentRename; |
||||||
|
} |
||||||
|
base.Dispose(disposing); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,85 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:19 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using ICSharpCode.Reporting.Addin.DesignableItems; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.TypeProvider |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of GroupedRowTypeProvider.
|
||||||
|
/// </summary>
|
||||||
|
class GroupedRowTypeProvider : TypeDescriptionProvider |
||||||
|
{ |
||||||
|
public GroupedRowTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||||
|
{ |
||||||
|
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||||
|
return new GroupedRowItemTypeDescriptor(td, instance); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
class GroupedRowItemTypeDescriptor : CustomTypeDescriptor |
||||||
|
{ |
||||||
|
public GroupedRowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||||
|
: base(parent) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override PropertyDescriptorCollection GetProperties() |
||||||
|
{ |
||||||
|
return GetProperties(null); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||||
|
{ |
||||||
|
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||||
|
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||||
|
|
||||||
|
TypeProviderHelper.AddDefaultProperties(allProperties,props); |
||||||
|
|
||||||
|
PropertyDescriptor prop = null; |
||||||
|
|
||||||
|
prop = props.Find("DrawBorder",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("ForeColor",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("Visible",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("FrameColor",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("Controls",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
// prop = props.Find("AlternateBackColor",true);
|
||||||
|
// allProperties.Add(prop);
|
||||||
|
//
|
||||||
|
// prop = props.Find("ChangeBackColorEveryNRow",true);
|
||||||
|
// allProperties.Add(prop);
|
||||||
|
|
||||||
|
prop = props.Find("PageBreakOnGroupChange",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
|
||||||
|
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,81 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:33 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using ICSharpCode.Reporting.Addin.DesignableItems; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.TypeProvider |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of RowItemTypeProvider.
|
||||||
|
/// </summary>
|
||||||
|
class RowItemTypeProvider : TypeDescriptionProvider |
||||||
|
{ |
||||||
|
public RowItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||||
|
{ |
||||||
|
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||||
|
return new RowItemTypeDescriptor(td, instance); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
internal class RowItemTypeDescriptor : CustomTypeDescriptor |
||||||
|
{ |
||||||
|
public RowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||||
|
: base(parent) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override PropertyDescriptorCollection GetProperties() |
||||||
|
{ |
||||||
|
return GetProperties(null); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||||
|
{ |
||||||
|
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||||
|
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||||
|
|
||||||
|
TypeProviderHelper.AddDefaultProperties(allProperties,props); |
||||||
|
|
||||||
|
PropertyDescriptor prop = null; |
||||||
|
|
||||||
|
prop = props.Find("DrawBorder",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("ForeColor",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("Visible",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("FrameColor",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
prop = props.Find("Controls",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
// prop = props.Find("AlternateBackColor",true);
|
||||||
|
// allProperties.Add(prop);
|
||||||
|
//
|
||||||
|
// prop = props.Find("ChangeBackColorEveryNRow",true);
|
||||||
|
// allProperties.Add(prop);
|
||||||
|
|
||||||
|
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 17:41 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Items |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseGroupHeader.
|
||||||
|
/// </summary>
|
||||||
|
public class BaseGroupHeader:BaseRowItem |
||||||
|
{ |
||||||
|
public BaseGroupHeader() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool PageBreakOnGroupChange {get;set;} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 04.05.2014 |
||||||
|
* Time: 18:01 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.PageBuilder.ExportColumns |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ExportRow.
|
||||||
|
/// </summary>
|
||||||
|
public class ExportRow:ExportContainer |
||||||
|
{ |
||||||
|
public ExportRow() |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue