/// <summary> /// Perform the appropriate action for this unit. If this is a parent undo unit, the /// parent must create an appropriate parent undo unit to contain the redo units. /// </summary> public override void Do() { UndoManager undoManager; IParentUndoUnit redo; TextPointer textPointerTable; Table table; undoManager = TopContainer as UndoManager; redo = null; textPointerTable = new TextPointer(_textContainer.Start, _cpTable, LogicalDirection.Forward); table = (Table)textPointerTable.Parent; _columnWidths[_columnIndex] -= _resizeAmount; if (_columnIndex < table.ColumnCount - 1) { _columnWidths[_columnIndex + 1] += _resizeAmount; } if (undoManager != null && undoManager.IsEnabled) { redo = new ColumnResizeUndoUnit(textPointerTable, _columnIndex, _columnWidths, -_resizeAmount); undoManager.Open(redo); } TextRangeEditTables.EnsureTableColumnsAreFixedSize(table, _columnWidths); if (redo != null) { undoManager.Close(redo, UndoCloseAction.Commit); } }
/// <summary> /// Perform the appropriate action for this unit. If this is a parent undo unit, the /// parent must create an appropriate parent undo unit to contain the redo units. /// </summary> public override void Do() { UndoManager undoManager; IParentUndoUnit redo; TextPointer textPointerTable; Table table; undoManager = TopContainer as UndoManager; redo = null; textPointerTable = new TextPointer(_textContainer.Start, _cpTable, LogicalDirection.Forward); table = (Table) textPointerTable.Parent; _columnWidths[_columnIndex] -= _resizeAmount; if(_columnIndex < table.ColumnCount - 1) { _columnWidths[_columnIndex + 1] += _resizeAmount; } if(undoManager != null && undoManager.IsEnabled) { redo = new ColumnResizeUndoUnit(textPointerTable, _columnIndex, _columnWidths, -_resizeAmount); undoManager.Open(redo); } TextRangeEditTables.EnsureTableColumnsAreFixedSize(table, _columnWidths); if(redo != null) { undoManager.Close(redo, UndoCloseAction.Commit); } }
// Token: 0x06002B4B RID: 11083 RVA: 0x000C592C File Offset: 0x000C3B2C public override void Do() { UndoManager undoManager = base.TopContainer as UndoManager; IParentUndoUnit parentUndoUnit = null; TextPointer textPointer = new TextPointer(this._textContainer.Start, this._cpTable, LogicalDirection.Forward); Table table = (Table)textPointer.Parent; this._columnWidths[this._columnIndex] -= this._resizeAmount; if (this._columnIndex < table.ColumnCount - 1) { this._columnWidths[this._columnIndex + 1] += this._resizeAmount; } if (undoManager != null && undoManager.IsEnabled) { parentUndoUnit = new ColumnResizeUndoUnit(textPointer, this._columnIndex, this._columnWidths, -this._resizeAmount); undoManager.Open(parentUndoUnit); } TextRangeEditTables.EnsureTableColumnsAreFixedSize(table, this._columnWidths); if (parentUndoUnit != null) { undoManager.Close(parentUndoUnit, UndoCloseAction.Commit); } }
// internal void ResizeColumn(Point mousePoint) { double dx = mousePoint.X - (_columnRect.X + _columnRect.Width / 2); dx = Math.Max(dx, - this.LeftDragMax); dx = Math.Min(dx, this.RightDragMax); int columnIndex = _columnIndex; Table table = this.Table; Invariant.Assert(table != null, "Table is not expected to be null"); Invariant.Assert(table.ColumnCount > 0, "ColumnCount is expected to be > 0"); _columnWidths[columnIndex] += dx; if(columnIndex < (table.ColumnCount - 1)) { _columnWidths[columnIndex + 1] -= dx; } TextRangeEditTables.EnsureTableColumnsAreFixedSize(table, _columnWidths); UndoManager undoManager = table.TextContainer.UndoManager; if(undoManager != null && undoManager.IsEnabled) { IParentUndoUnit columnResizeUndoUnit = new ColumnResizeUndoUnit(table.ContentStart, columnIndex, _columnWidths, dx); undoManager.Open(columnResizeUndoUnit); undoManager.Close(columnResizeUndoUnit, UndoCloseAction.Commit); } // Discard table resizing adorner this.DisposeAdorner(); }