예제 #1
0
        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));
            }
        }
예제 #2
0
 void IExcelCommand.Read(BinaryReader r)
 {
     Value      = r.ReadBoolean() ? r.ReadString() : null;
     ActionKind = (ViewActionKind)r.ReadInt32();
 }
예제 #3
0
 public ViewAction(string value, ViewActionKind actionKind)
 {
     When       = When.Normal;
     Value      = value;
     ActionKind = actionKind;
 }
예제 #4
0
 public ViewAction(int row, int col, ViewActionKind actionKind)
     : this(ExcelService.GetAddress(row, col), actionKind)
 {
 }