33 lines
625 B
C#
33 lines
625 B
C#
using System;
|
|
|
|
namespace CPF.ReoGrid.Actions
|
|
{
|
|
public class InsertWorksheetAction : WorkbookAction
|
|
{
|
|
public int Index { get; private set; }
|
|
|
|
public Worksheet Worksheet { get; private set; }
|
|
|
|
public InsertWorksheetAction(int index, Worksheet worksheet) : base(null)
|
|
{
|
|
this.Index = index;
|
|
this.Worksheet = worksheet;
|
|
}
|
|
|
|
public override void Do()
|
|
{
|
|
base.Workbook.InsertWorksheet(this.Index, this.Worksheet);
|
|
}
|
|
|
|
public override void Undo()
|
|
{
|
|
base.Workbook.RemoveWorksheet(this.Index);
|
|
}
|
|
|
|
public override string GetName()
|
|
{
|
|
return "Insert Worksheet: " + this.Worksheet.Name;
|
|
}
|
|
}
|
|
}
|