ComponentDropLocation (Direction direction) { var insertMode = switch (direction) { case LEFT -> GridInsertMode.ColumnBefore; case UP -> GridInsertMode.RowBefore; case RIGHT -> GridInsertMode.ColumnAfter; case DOWN -> GridInsertMode.RowAfter; }; return new GridInsertLocation(myContainer, myRow, myColumn, insertMode); }