Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6363 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
47 changed files with 323 additions and 81 deletions
@ -0,0 +1,57 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 30.07.2010 |
||||||
|
* Time: 20:03 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.ComponentModel.Design; |
||||||
|
using System.Drawing; |
||||||
|
using System.Windows.Forms.Design; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reports.Addin.Designer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseGroupHeaderDesigner.
|
||||||
|
/// </summary>
|
||||||
|
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.GroupHeaderDesigner))] |
||||||
|
public class GroupHeaderDesigner:ParentControlDesigner |
||||||
|
{ |
||||||
|
|
||||||
|
private ISelectionService selectionService; |
||||||
|
|
||||||
|
public GroupHeaderDesigner() |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public override void Initialize(IComponent component) |
||||||
|
{ |
||||||
|
if (component == null) { |
||||||
|
throw new ArgumentNullException("component"); |
||||||
|
} |
||||||
|
base.Initialize(component); |
||||||
|
GetService (); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void OnSelectionChanged(object sender, EventArgs e) |
||||||
|
{ |
||||||
|
Control.Invalidate( ); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void GetService () |
||||||
|
{ |
||||||
|
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||||
|
if (selectionService != null) |
||||||
|
{ |
||||||
|
selectionService.SelectionChanged += OnSelectionChanged; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,22 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 30.07.2010 |
||||||
|
* Time: 20:02 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reports.Addin.Project.Designer |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of Class1.
|
||||||
|
/// </summary>
|
||||||
|
public class Class1 |
||||||
|
{ |
||||||
|
public Class1() |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,124 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 30.07.2010 |
||||||
|
* Time: 19:19 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Drawing; |
||||||
|
|
||||||
|
using ICSharpCode.Reports.Addin.Designer; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reports.Addin |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseGroupHeader.
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
|
||||||
|
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.GroupHeaderDesigner))] |
||||||
|
|
||||||
|
public class BaseGroupHeader:AbstractItem |
||||||
|
{ |
||||||
|
public BaseGroupHeader():base() |
||||||
|
{ |
||||||
|
TypeDescriptor.AddProvider(new GroupItemTypeProvider(), typeof(BaseGroupHeader)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
[System.ComponentModel.EditorBrowsableAttribute()] |
||||||
|
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||||
|
{ |
||||||
|
base.OnPaint(e); |
||||||
|
this.Draw (e.Graphics); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public override void Draw(System.Drawing.Graphics graphics) |
||||||
|
{ |
||||||
|
if (graphics == null) { |
||||||
|
throw new ArgumentNullException("graphics"); |
||||||
|
} |
||||||
|
using (Brush b = new SolidBrush(this.BackColor)){ |
||||||
|
graphics.FillRectangle(b, base.DrawingRectangle); |
||||||
|
} |
||||||
|
|
||||||
|
base.DrawControl(graphics,base.DrawingRectangle); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
internal class GroupItemTypeProvider : TypeDescriptionProvider |
||||||
|
{ |
||||||
|
public GroupItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
// public RowItemTypeProvider(TypeDescriptionProvider parent): base(parent)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||||
|
{ |
||||||
|
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||||
|
return new GroupItemTypeDescriptor(td, instance); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
internal class GroupItemTypeDescriptor : CustomTypeDescriptor |
||||||
|
{ |
||||||
|
public GroupItemTypeDescriptor(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>(); |
||||||
|
|
||||||
|
DesignerHelper.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()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue