Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Documents / ColumnResizeUndoUnit.cs / 1 / ColumnResizeUndoUnit.cs
//---------------------------------------------------------------------------- // // File: ColumnResizeUndoUnit.cs // // Description: Undo unit for resizing columns // // History: // 01/27/2005 : GHermann - Created // //--------------------------------------------------------------------------- using MS.Internal.Documents; namespace System.Windows.Documents { internal class ColumnResizeUndoUnit : ParentUndoUnit { #region Constructors internal ColumnResizeUndoUnit(TextPointer textPointerTable, int columnIndex, double[] columnWidths, double resizeAmount) : base("ColumnResize") { _textContainer = textPointerTable.TextContainer; _cpTable = _textContainer.Start.GetOffsetToPosition(textPointerTable); _columnWidths = columnWidths; _columnIndex = columnIndex; _resizeAmount = resizeAmount; } #endregion Constructors #region Public Methods ////// 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. /// 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); } } #endregion Public Methods #region Private Data private TextContainer _textContainer; private double[] _columnWidths; private int _cpTable; private int _columnIndex; private double _resizeAmount; #endregion Private Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ColumnResizeUndoUnit.cs // // Description: Undo unit for resizing columns // // History: // 01/27/2005 : GHermann - Created // //--------------------------------------------------------------------------- using MS.Internal.Documents; namespace System.Windows.Documents { internal class ColumnResizeUndoUnit : ParentUndoUnit { #region Constructors internal ColumnResizeUndoUnit(TextPointer textPointerTable, int columnIndex, double[] columnWidths, double resizeAmount) : base("ColumnResize") { _textContainer = textPointerTable.TextContainer; _cpTable = _textContainer.Start.GetOffsetToPosition(textPointerTable); _columnWidths = columnWidths; _columnIndex = columnIndex; _resizeAmount = resizeAmount; } #endregion Constructors #region Public Methods ////// 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. /// 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); } } #endregion Public Methods #region Private Data private TextContainer _textContainer; private double[] _columnWidths; private int _cpTable; private int _columnIndex; private double _resizeAmount; #endregion Private Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SingleBodyParameterMessageFormatter.cs
- Int64Converter.cs
- TextParagraphView.cs
- SqlNotificationRequest.cs
- _NetworkingPerfCounters.cs
- DbConnectionPoolGroup.cs
- AxImporter.cs
- XmlHierarchicalDataSourceView.cs
- SqlGenerator.cs
- BitmapSourceSafeMILHandle.cs
- TimelineCollection.cs
- WSMessageEncoding.cs
- MailBnfHelper.cs
- basecomparevalidator.cs
- DataGridViewAdvancedBorderStyle.cs
- TreeNode.cs
- SQLInt32.cs
- DiscoveryClientDocuments.cs
- RawStylusInputReport.cs
- SourceElementsCollection.cs
- DoubleSumAggregationOperator.cs
- EventProperty.cs
- ObservableCollection.cs
- UrlAuthFailedErrorFormatter.cs
- TimeSpanConverter.cs
- HostedElements.cs
- NavigationPropertyAccessor.cs
- SystemThemeKey.cs
- SqlBuffer.cs
- DataControlCommands.cs
- LinearGradientBrush.cs
- CategoryAttribute.cs
- XmlFormatWriterGenerator.cs
- EtwTrace.cs
- OdbcError.cs
- NestPullup.cs
- HelpFileFileNameEditor.cs
- ObjectDisposedException.cs
- RuntimeConfig.cs
- ConfigurationManagerInternalFactory.cs
- ExecutionPropertyManager.cs
- HandleTable.cs
- MatrixKeyFrameCollection.cs
- StringFormat.cs
- CategoryGridEntry.cs
- SerializableAttribute.cs
- HttpApplicationStateBase.cs
- GPRECT.cs
- InternalDuplexChannelFactory.cs
- InheritanceAttribute.cs
- ColumnMap.cs
- GenericTypeParameterBuilder.cs
- FileNameEditor.cs
- BaseCollection.cs
- ToolboxSnapDragDropEventArgs.cs
- WindowsPrincipal.cs
- RangeExpression.cs
- WebPartEventArgs.cs
- ProfileModule.cs
- CodeCommentStatement.cs
- PropertyManager.cs
- CachedPathData.cs
- DictationGrammar.cs
- LinqDataSourceContextData.cs
- XmlDataLoader.cs
- BaseCollection.cs
- ImportedPolicyConversionContext.cs
- WorkflowMarkupElementEventArgs.cs
- RevocationPoint.cs
- ErrorWebPart.cs
- ComponentResourceKeyConverter.cs
- MailWebEventProvider.cs
- DataGridViewSelectedCellCollection.cs
- WebPartConnection.cs
- StateFinalizationActivity.cs
- OracleBinary.cs
- ToolBarButtonDesigner.cs
- RadioButtonAutomationPeer.cs
- DataGridViewRowPrePaintEventArgs.cs
- ChangeBlockUndoRecord.cs
- WmfPlaceableFileHeader.cs
- Membership.cs
- FixedDocumentPaginator.cs
- Attributes.cs
- RegularExpressionValidator.cs
- ToolboxControl.cs
- PreProcessInputEventArgs.cs
- SmiSettersStream.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SqlGatherConsumedAliases.cs
- WindowsListViewGroupHelper.cs
- JournalEntryStack.cs
- SoapElementAttribute.cs
- ProtectedConfiguration.cs
- DbConvert.cs
- FontStretch.cs
- ControlTemplate.cs
- TimeSpanSecondsConverter.cs
- PrtCap_Public.cs
- ColorKeyFrameCollection.cs