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

📄 reportimageitem.cs

📁 SharpDevelop2.0.0 c#开发免费工具
💻 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>
//------------------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using SharpReportCore;
using SharpReport.Designer;	
	/// <summary>
	/// 
	/// </summary>
	/// <remarks>
	/// 	created by - Forstmeier Peter
	/// 	created on - 04.10.2005 11:15:23
	/// </remarks>
namespace SharpReport.ReportItems {	
	
	public class ReportImageItem : BaseImageItem,SharpReport.Designer.IDesignable {
		
		private	ReportImageControl visualControl;

		public ReportImageItem() :base(){
			
			visualControl = new ReportImageControl();
			ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this);
			
			Setup();
			
			this.visualControl.Click += new EventHandler(OnControlSelect);
			this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged);
			this.visualControl.BackColorChanged += new EventHandler (OnControlChanged);
			this.visualControl.FontChanged += new EventHandler (OnControlChanged);
			this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
			base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
			
			//Event from Tracker
			this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
		}
		
		private void Setup() {
			this.visualControl.Location = base.Location;
			this.visualControl.Size = base.Size;
			
			if (base.Image != null) {
				this.visualControl.Image = base.Image;
				this.visualControl.ScaleImageToSize = base.ScaleImageToSize;
				this.visualControl.Invalidate();
			} 
		}
		
		#region EventHandling
		
		//Tracker
		private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
			ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
			this.HandlePropertyChanged(e.PropertyName);
		}
		
		private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
			Setup();
			ItemsHelper.UpdateControlFromGraphicBase(this.visualControl,this);
			this.HandlePropertyChanged(e.PropertyName);
		}
		
		private void OnControlChanged (object sender, EventArgs e) {
			Setup();
			base.SuspendLayout();
			ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this);
			base.ResumeLayout();
			this.HandlePropertyChanged("OnControlChanged");
		}
		
		private void OnControlSelect(object sender, EventArgs e){
			if (Selected != null)
				Selected(this,e);
		}	
		
		/// <summary>
		/// A Property in ReportItem has changed, inform the Designer
		/// to set the View's 'IsDirtyFlag' to true
		/// </summary>
		
		protected void HandlePropertyChanged(string info) {
			if ( !base.Suspend) {
				if (PropertyChanged != null) {
					PropertyChanged (this,new PropertyChangedEventArgs(info));
				}
			}
			
		}
		
		#endregion
		
		#region SharpReport.Designer.IDesignable interface implementation
		[System.Xml.Serialization.XmlIgnoreAttribute]
		[Browsable(false)]
		public ReportObjectControlBase VisualControl {
			get {
				return visualControl;
			}
		}
		
		public new event PropertyChangedEventHandler PropertyChanged;
		public event EventHandler <EventArgs> Selected;

		#endregion
		
		#region overrides
		
		public override Size Size {
			get {
				return base.Size;
			}
			set {
				base.Size = value;
				if (this.visualControl != null) {
					this.visualControl.Size = value;
				}
				this.HandlePropertyChanged("Size");
			}
		}
		
		public override Point Location {
			get {
				return base.Location;
			}
			set {
				base.Location = value;
				if (this.visualControl != null) {
					this.visualControl.Location = value;
				}
				this.HandlePropertyChanged("Location");
			}
		}
		
//		public override Image Image {
//			get {
//				return base.Image;
//			}
//		}
//		
		
		public override void Dispose() {
			base.Dispose();
			this.visualControl.Dispose();
		}
		
		public override string ToString(){
			return this.Name;
		}
		
		#endregion
	}
}

⌨️ 快捷键说明

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