using System; namespace CPF.ReoGrid.Actions { public class RemoveRangeBorderAction : WorksheetReusableAction { public BorderPositions BorderPos { get; set; } public RemoveRangeBorderAction(RangePosition range, BorderPositions pos) : base(range) { this.BorderPos = pos; } public override void Do() { this.backupData = base.Worksheet.GetPartialGrid(base.Range, PartialGridCopyFlag.BorderAll, ExPartialGridCopyFlag.BorderOutsideOwner, false); base.Worksheet.RemoveRangeBorders(base.Range, this.BorderPos); } public override void Undo() { base.Worksheet.SetPartialGrid(base.Range, this.backupData, PartialGridCopyFlag.BorderAll, ExPartialGridCopyFlag.BorderOutsideOwner); } public override string GetName() { return "Set Range Border"; } public override WorksheetReusableAction Clone(RangePosition range) { return new RemoveRangeBorderAction(range, this.BorderPos); } private PartialGrid backupData; } }