⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reportobject.cs

📁 c#源代码
💻 CS
字号:
/*
 * Created by SharpDevelop.
 * User: Forstmeier Peter
 * Date: 13.11.2004
 * Time: 22:30
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Reflection;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Printing;

using System.Windows.Forms;
using System.Xml;
using System.Xml.Serialization;

using SharpReportCore;

using SharpReport.Designer;
//using SharpReport.Printing;

namespace SharpReport
{
	/// <summary>
	/// Description of ReportObject.
	/// </summary>
	
	public abstract class ReportObject :BaseReportObject{
		private ReportObjectControlBase visualControl;

		#region Events Declaration
		[EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
		
		public event SelectedEventHandler Selected;		
		#endregion			
		
		internal ReportObject():base(){
			
		}
		
		~ReportObject()
		{
			if (visualControl != null)
				if (!visualControl.IsDisposed)
					visualControl.Dispose();			
		}
		
		
		[Browsable(false)]
		[XmlIgnoreAttribute]
		internal ReportObjectControlBase VisualControl
		{
			get { return visualControl; }
			set {
				visualControl = value;
				this.Name = visualControl.Name;
			}
		}
		
		[Browsable(false)]
		[XmlIgnoreAttribute]
		public string Object
		{
			get {
				return visualControl.Name;
			}
			set {
				visualControl.Name = value;
			}
		}		

//		public virtual Color BackColor
//		{
//			get {
//				return visualControl.BackColor;
//			}
//			set {
//				visualControl.BackColor = value;
//			}
//		}		
		/// <summary>
		/// Set Size only for th Bodypart of Control
		/// </summary>

		public override Size Size
		{
			get {
				if (this.visualControl != null) {
					return visualControl.Body.Size;
				} else {
					return this.Size;
				}
			
			}
			set {
				this.Size = value;
				if (this.visualControl != null) {
					visualControl.Body.Size = this.Size;
				}
			}
		}
		
		public override bool Visible
		{
			get { return visualControl.Visible; }
			set { visualControl.Visible = value; }
		}

		#region Events Implementation		
		
		public virtual void FireAfterPrint(PointF point){
			base.OnAfterPrint(point);
		}
		
		private void OnBeforePrint(EventArgs e){
			base.OnBeforePrint();
		}
		
		
		public void OnSelect(object sender, EventArgs e)
		{
			if (Selected != null)
				Selected(sender, e);
		}				
		
		#endregion				
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -