protected override void DoSelfRedo(HCUndo aRedo) { if (aRedo.Data is HCSizeUndoData) { HCSizeUndoData vSizeAction = aRedo.Data as HCSizeUndoData; this.Width = vSizeAction.NewWidth; this.Height = vSizeAction.NewHeight; } else { base.DoSelfRedo(aRedo); } }
// 撤销恢复相关方法 protected void SelfUndo_Resize(int aNewWidth, int aNewHeight) { HCUndoList vUndoList = GetSelfUndoList(); if ((vUndoList != null) && vUndoList.Enable) { SelfUndo_New(); HCUndo vUndo = vUndoList.Last; if (vUndo != null) { HCSizeUndoData vSizeUndoData = new HCSizeUndoData(); vSizeUndoData.OldWidth = this.Width; vSizeUndoData.OldHeight = this.Height; vSizeUndoData.NewWidth = aNewWidth; vSizeUndoData.NewHeight = aNewHeight; vUndo.Data = vSizeUndoData; } } }