Class RevisionInsertDelete

RevisionInsertDelete class

Represents a revision record of a row/column insert/delete action.

public class RevisionInsertDelete : Revision

Properties

NameDescription
ActionType { get; }Gets the action type of this revision.
CellArea { get; }Gets the inserting/deleting range.
Id { get; }Gets the number of this revision.(Inherited from Revision.)
Revisions { get; }Gets revision list by this operation.
override Type { get; }Represents the type of revision.
Worksheet { get; }Gets the worksheet.(Inherited from Revision.)

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Revisions;

namespace AsposeCellsExamples
{
    public class RevisionsClassRevisionInsertDeleteDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            workbook.Settings.Shared = true;

            Worksheet worksheet = workbook.Worksheets[0];
            worksheet.Cells.InsertRow(0);
            worksheet.Cells.DeleteColumn(0);

            string filePath = "RevisionsDemo.xlsx";
            workbook.Save(filePath);

            Workbook reopenedWorkbook = new Workbook(filePath);
            foreach (RevisionLog log in reopenedWorkbook.Worksheets.RevisionLogs)
            {
                foreach (Revision revision in log.Revisions)
                {
                    if (revision.Type == RevisionType.InsertDelete)
                    {
                        RevisionInsertDelete rid = (RevisionInsertDelete)revision;
                        Console.WriteLine($"ActionType: {rid.ActionType}, CellArea: {rid.CellArea}");
                    }
                }
            }
        }
    }
}

See Also