CPF/CPF.ReoGrid/Actions/RemoveRangeBorderAction.cs

38 lines
965 B
C#
Raw Normal View History

2024-06-24 10:15:59 +08:00
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;
}
}