public static void ViewAction(this IExcelContext ctx, object value, ViewActionKind actionKind) { var view = ((ExcelContext)ctx).WS.View; switch (actionKind) { case ViewActionKind.FreezePane: ExcelService.CellToInts((string)value, out var row, out var col); view.FreezePanes(row, col); break; case ViewActionKind.SetTabSelected: view.SetTabSelected(); break; case ViewActionKind.UnfreezePane: view.UnFreezePanes(); break; default: throw new ArgumentOutOfRangeException(nameof(actionKind)); } }
void IExcelCommand.Read(BinaryReader r) { Value = r.ReadBoolean() ? r.ReadString() : null; ActionKind = (ViewActionKind)r.ReadInt32(); }
public ViewAction(string value, ViewActionKind actionKind) { When = When.Normal; Value = value; ActionKind = actionKind; }
public ViewAction(int row, int col, ViewActionKind actionKind) : this(ExcelService.GetAddress(row, col), actionKind) { }