public object Clone() { PmsImageBoxWrapper pib = new PmsImageBoxWrapper(); pib.Border = this.Border; pib.BorderName = this.BorderName; if (null != this.Image) { pib.Image = this.Image.Clone() as Image; } if (null != ErrorImage) { pib.ErrorImage = this.ErrorImage.Clone() as Image; } pib.ExternDatas = new List <PMS.Libraries.ToolControls.Report.Elements.Util.ExternData>(); pib.Mode = this.Mode; foreach (ExternData ed in ExternDatas) { object value = ed.Value; if (null != value && value is ICloneable) { value = ((ICloneable)value).Clone(); } pib.ExternDatas.Add(new ExternData(ed.Key, value)); } if (null != this.Border) { pib.Border = this.Border.Clone() as ElementBorder; pib.Border.OwnerElement = pib; } if (null != SourceField) { pib.SourceField = SourceField.Clone() as SourceField; } pib.DbField = DbField; pib.Width = this.Width; pib.Height = this.Height; pib.HasLeftBorder = this.HasLeftBorder; pib.HasTopBorder = this.HasTopBorder; pib.HasRightBorder = this.HasRightBorder; pib.HasBottomBorder = this.HasBottomBorder; pib.HasBorder = this.HasBorder; pib.Location = this.Location; pib.BackColor = this.BackColor; pib.Visible = Visible; pib.MESType = MESType; pib.Name = Name; if (null != ((IElement)this).ExtendObject) { ((IElement)pib).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject; } return(pib); }
public IControlTranslator ToElement(bool transferChild) { PmsImageBoxWrapper pib = new PmsImageBoxWrapper(); pib.Border = this.Border; pib.BorderName = this.BorderName; if (null != this.Image) { pib.Image = this.Image.Clone() as Image; } if (null != ErrorImage) { pib.ErrorImage = this.ErrorImage.Clone() as Image; } pib.ExternDatas = new List <PMS.Libraries.ToolControls.Report.Elements.Util.ExternData>(); pib.Mode = this.Mode; foreach (ExternData data in ExternDatas) { object value = data.Value; if (null != value && value is ICloneable) { value = ((ICloneable)value).Clone(); } pib.ExternDatas.Add(new ExternData(data.Key, value)); } if (null != this.Border) { pib.Border = this.Border.Clone() as ElementBorder; pib.Border.OwnerElement = pib; } if (null != SourceField) { pib.SourceField = SourceField.Clone() as SourceField; } if (_orginalFontSize > 0) { pib.Font = new Font(Font.FontFamily, _orginalFontSize); } else { pib.Font = new Font(this.Font.FontFamily, this.Font.Size); } pib.VerticalScale = 1f; pib.HorizontalScale = 1f; pib.DbField = DbField; pib.Visible = Visible; pib.MESType = MESType; pib.Name = Name; if (_orginalHeight > 0) { pib.Height = this._orginalHeight; } else { pib.Height = this.Height; } if (_orginalWidth > 0) { pib.Width = _orginalWidth; } else { pib.Width = this.Width; } //pib.VerticalScale = this.VerticalScale; //pib.HorizontalScale = this.HorizontalScale; if (_orginalLocation != Point.Empty) { pib.Location = this._orginalLocation; } else { pib.Location = this.Location; } pib.HasLeftBorder = this.HasLeftBorder; pib.HasTopBorder = this.HasTopBorder; pib.HasRightBorder = this.HasRightBorder; pib.HasBottomBorder = this.HasBottomBorder; pib.HasBorder = this.HasBorder; pib.BackColor = this.BackColor; if (null != ((IElement)this).ExtendObject) { ((IElement)pib).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject; } return(pib); }
public PmsImageBox(IElement element) : base() { PmsImageBoxWrapper pib = element as PmsImageBoxWrapper; if (null != pib.Border) { Border = pib.Border.Clone() as ElementBorder; Border.OwnerElement = this; } BorderName = pib.BorderName; if (null != pib.Image) { Image = pib.Image.Clone() as Image; } if (null != pib.ErrorImage) { ErrorImage = pib.ErrorImage.Clone() as Image; } ExternDatas = new List <PMS.Libraries.ToolControls.Report.Elements.Util.ExternData>(); Mode = pib.Mode; if (null != pib.ExternDatas) { foreach (ExternData ed in pib.ExternDatas) { object value = ed.Value; if (null != value && value is ICloneable) { value = ((ICloneable)value).Clone(); } ExternDatas.Add(new ExternData(ed.Key, value)); } } if (null != pib.Border) { Border = pib.Border.Clone() as ElementBorder; Border.OwnerElement = this; } if (null != pib.SourceField) { SourceField = pib.SourceField.Clone() as SourceField; } DbField = pib.DbField; Width = pib.Width; Height = pib.Height; HasLeftBorder = pib.HasLeftBorder; HasTopBorder = pib.HasTopBorder; HasRightBorder = pib.HasRightBorder; HasBottomBorder = pib.HasBottomBorder; HasBorder = pib.HasBorder; Location = pib.Location; BackColor = pib.BackColor; Visible = pib.Visible; MESType = pib.MESType; Name = pib.Name; if (null != ((IElement)pib).ExtendObject) { ((IElement)this).ExtendObject = ((IElement)pib).ExtendObject.Clone() as ExtendObject; } //return pib; }