📄 basereportitem.cs
字号:
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
namespace SharpReportCore {
using System;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Drawing;
/// <summary>
/// This Class is the BaseClass for <see cref="BaseTextItem"></see>
/// and <see cref="BaseGraphicItem"></see>
/// </summary>
public class BaseReportItem : SharpReportCore.BaseReportObject,
IItemRenderer,IComponent{
private int offset = 0;
private int margin = 0;
private bool drawBorder = false;
private Color foreColor;
private Font font;
private ISite site;
public event FormatOutputEventHandler FormatOutput;
public event EventHandler Disposed;
public BaseReportItem() :base(){
site = null;
}
#region Event's handling
/// <summary>
/// Format a string according to his datatype
/// </summary>
/// <param name="toFormat">The String to Format</param>
/// <param name="formatString">the formatString</param>
/// <param name="nullValue">Value to return when there is null in toFormat</param>
/// <returns></returns>
protected string FireFormatOutput(string toFormat,string formatString, string nullValue) {
if (FormatOutput != null) {
FormatOutputEventArgs ea = new FormatOutputEventArgs (toFormat,
formatString,
nullValue);
FormatOutput (this,ea);
return ea.FormatedString;
}
return toFormat;
}
#endregion
#region virtual method's
protected RectangleF DrawingRectangle (ReportPageEventArgs e,SizeF measureSize) {
PointF upperLeft = new PointF (this.Location.X + this.Margin,
this.Location.Y + this.Offset);
SizeF lowerRight = new SizeF(0,0);
if ((this.CanGrow == true )||(this.CanShrink == true)){
if (measureSize.Height > this.Size.Height ) {
lowerRight = new SizeF (this.Size.Width,
measureSize.Height);
}
} else {
lowerRight = new SizeF (this.Size.Width,
this.Size.Height);
}
return new RectangleF (upperLeft,lowerRight);
}
#endregion
#region System.ComponentModel.IComponent interface implementation
public System.ComponentModel.ISite Site {
get {
return site;
}
set {
site = value;
}
}
#endregion
#region System.IDisposable interface implementation
public virtual void Dispose() {
if(Disposed != null){
Disposed(this,EventArgs.Empty);
}
}
#endregion
#region Properties
[XmlIgnoreAttribute]
public int Margin {
get {
return margin;
}
set {
margin = value;
}
}
[XmlIgnoreAttribute]
public int Offset {
get {
return offset;
}
set {
offset = value;
}
}
[Browsable(true),
Category("Appearance"),
Description("Draw a Border around the Item")]
public bool DrawBorder {
get {
return drawBorder;
}
set {
drawBorder = value;
}
}
public virtual Color ForeColor {
get {
return foreColor;
}
set {
foreColor = value;
base.NotifyPropertyChanged ("ForeColor",true);
}
}
public virtual Font Font {
get {
return this.font;
}
set {
this.font = value;
NotifyPropertyChanged ("Font",true);
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -