Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6419 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
14 changed files with 193 additions and 70 deletions
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 15.08.2010 |
||||
* Time: 19:40 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GroupedRowDesigner.
|
||||
/// </summary>
|
||||
public class GroupedRowDesigner:RowItemDesigner |
||||
{ |
||||
private ISelectionService selectionService; |
||||
|
||||
public GroupedRowDesigner() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,98 @@
@@ -0,0 +1,98 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 15.08.2010 |
||||
* Time: 19:38 |
||||
* |
||||
* 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; |
||||
using ICSharpCode.Reports.Core; |
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GroupedRow.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.GroupedRowDesigner))] |
||||
public class BaseGroupedRowItem:BaseRowItem |
||||
{ |
||||
public BaseGroupedRowItem() |
||||
{ |
||||
|
||||
// http://www.cetix.de/DotNetNews/Thread188109-Schlankes_Grid.aspx
|
||||
// http://msdn.microsoft.com/en-us/library/t9abe4ab(vs.71).aspx
|
||||
TypeDescriptor.AddProvider(new GroupedRowTypeProvider(), typeof(BaseGroupedRowItem)); |
||||
} |
||||
} |
||||
|
||||
internal 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); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal 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>(); |
||||
|
||||
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("Padding",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