public void Redo() { if (report != null) { if (oldComponent is CustomControl) { BandBase base2 = report.FindBandPosY(((CustomControl)oldComponent).Location.Y); ((CustomControl)oldComponent).Band = base2; ((CustomControl)oldComponent).´¹Ö±Î»Öà = ((CustomControl)oldComponent).Location.Y - ((CustomControl)oldComponent).Band.Top; } report.ParentControl.Controls.Add(oldComponent as Control); report.SetCurrentControl(oldComponent as Control); return; //if(oldComponent is C1.Win.C1TrueDBGrid.C1TrueDBGrid) //{ // C1.Win.C1TrueDBGrid.C1TrueDBGrid c1 = oldComponent as C1.Win.C1TrueDBGrid.C1TrueDBGrid; // report.AddC1TrueDBGrid(c1); // return; //} object comp = report.CreateComponent(componentType, cx, cy, width, heigh); if (comp == null) { return; } //if(comp is C1.Win.C1TrueDBGrid.C1TrueDBGrid) //{ // Junxian.XReport.XmlControl.SetControlPropertyValueAddChildrenNoName(oldComponent, comp); //} //else //{ // Junxian.XReport.XmlControl.SetControlPropertyValueNoName(oldComponent, comp); //} if (comp is Control) { report.ParentControl.Controls.Add(comp as Control); } oldComponent = comp; if (oldComponent is Control) { Control con = oldComponent as Control; cx = con.Location.X; cy = con.Location.Y; width = con.Width; heigh = con.Height; } } }
public void Undo() { if (oldComponent is CustomControl) { BandBase base2 = report.FindBandPosY(((CustomControl)oldComponent).Location.Y); ((CustomControl)oldComponent).Band = base2; ((CustomControl)oldComponent).´¹Ö±Î»Öà = ((CustomControl)oldComponent).Location.Y - ((CustomControl)oldComponent).Band.Top; } report.ParentControl.Controls.Add(oldComponent as Control); report.SetCurrentControl(oldComponent as Control); return; }
public void Undo() { // if(oldValue == null) return; if (oldcomponent == null) { return; } object component = null; if (oldcomponent is Control && componentName != null) { component = report.GetControl(oldcomponent as Control, componentName); // report.DestroyComponent(oldcomponent as Control); //component = oldcomponent; } if (component == null) { component = oldcomponent; } report.OnComponentChanging(component, member); if (component is PictureBox && PropName == "Image" && oldImagePath != null) { PictureBox pictureBox = component as PictureBox; newImagePath = report.GetPropertyValue(pictureBox.Name, "Image"); SetPictureBoxImage(component as PictureBox, oldImagePath); //report.Edit_Info("Name", pictureBox.Name, "Image", oldImagePath); return; } Type t = component.GetType(); PropertyInfo pInfo = t.GetProperty(member.Name); try { pInfo.SetValue(component, oldValue, null); //control.Location = new Point(control.Location.X, base2.Top + control.垂直位置); //component. if (component is CustomControl) { ((CustomControl)component).Cs.Remove(); BandBase base2 = report.FindBandPosY(((CustomControl)component).Location.Y); ((CustomControl)component).Band = base2; ((CustomControl)component).垂直位置 = ((CustomControl)component).Location.Y - ((CustomControl)component).Band.Top; } if (component is BandDesigner) { report.CurrentBandControl = (BandDesigner)component; report.CurrentBand = (BandBase)((BandDesigner)component).Tag; report.ArrangeAreaDesigner(); report.SetRulers(); report.ArrangeBands(); report.BandControlPaint(this, null); } WriteXmlProperty(component, oldValue); } catch {} report.OnComponentChanged(component, member, newValue, oldValue); }