10 changed files with 217 additions and 59 deletions
@ -0,0 +1,48 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 17.04.2014 |
||||||
|
* Time: 19:53 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Drawing; |
||||||
|
using ICSharpCode.Reporting.Addin.Designer; |
||||||
|
using ICSharpCode.Reporting.Addin.TypeProvider; |
||||||
|
|
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.Addin.DesignableItems |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of BaseCircleItem.
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
[Designer(typeof(ContainerDesigner))] |
||||||
|
class BaseCircleItem:AbstractGraphicItem |
||||||
|
{ |
||||||
|
public BaseCircleItem() |
||||||
|
{ |
||||||
|
TypeDescriptor.AddProvider(new CircleItemTypeProvider(), typeof(BaseCircleItem)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override void Draw(Graphics graphics) |
||||||
|
{ |
||||||
|
if (graphics == null) { |
||||||
|
throw new ArgumentNullException("graphics"); |
||||||
|
} |
||||||
|
|
||||||
|
var rect = new Rectangle(ClientRectangle.Left, |
||||||
|
ClientRectangle.Top, |
||||||
|
ClientRectangle.Right -1, |
||||||
|
ClientRectangle.Bottom -1); |
||||||
|
|
||||||
|
using (var pen = new Pen(ForeColor,Thickness)) { |
||||||
|
graphics.DrawEllipse(pen,rect); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,64 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 17.04.2014 |
||||||
|
* Time: 19:57 |
||||||
|
* |
||||||
|
* 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 CircleItemTypeProvider.
|
||||||
|
/// </summary>
|
||||||
|
class CircleItemTypeProvider: TypeDescriptionProvider |
||||||
|
{ |
||||||
|
public CircleItemTypeProvider(): base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||||
|
{ |
||||||
|
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||||
|
return new CircleItemTypeDescriptor(td, instance); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
class CircleItemTypeDescriptor : CustomTypeDescriptor |
||||||
|
{ |
||||||
|
|
||||||
|
public CircleItemTypeDescriptor(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); |
||||||
|
TypeProviderHelper.AddGraphicProperties(allProperties,props); |
||||||
|
|
||||||
|
PropertyDescriptor prop = null; |
||||||
|
|
||||||
|
prop = props.Find("Controls",true); |
||||||
|
allProperties.Add(prop); |
||||||
|
|
||||||
|
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 16.04.2014 |
||||||
|
* Time: 19:53 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Reporting.PageBuilder.ExportColumns |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of GraphicsContainer.
|
||||||
|
/// </summary>
|
||||||
|
public class GraphicsContainer:ExportContainer |
||||||
|
{ |
||||||
|
|
||||||
|
public int Thickness {get;set;} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue