Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / ColumnResizeUndoUnit.cs / 1305600 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContractBase.cs
- SharedDp.cs
- ResolveMatches11.cs
- HttpCacheVaryByContentEncodings.cs
- FormViewModeEventArgs.cs
- DocumentScope.cs
- EventItfInfo.cs
- CalendarButtonAutomationPeer.cs
- SiteMapDataSource.cs
- AuthorizationRuleCollection.cs
- ColumnResizeAdorner.cs
- BindingSourceDesigner.cs
- CultureTable.cs
- ServicesUtilities.cs
- SEHException.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- AuthorizationRule.cs
- XPathParser.cs
- OracleRowUpdatedEventArgs.cs
- MediaContext.cs
- CopyOnWriteList.cs
- TimeSpanMinutesConverter.cs
- VoiceSynthesis.cs
- PointHitTestResult.cs
- OdbcConnectionFactory.cs
- ButtonAutomationPeer.cs
- DesignerVerbToolStripMenuItem.cs
- PhoneCallDesigner.cs
- DiscreteKeyFrames.cs
- BasicHttpBinding.cs
- InternalSafeNativeMethods.cs
- SafeCoTaskMem.cs
- MapPathBasedVirtualPathProvider.cs
- Encoder.cs
- IISUnsafeMethods.cs
- WebPartEditorOkVerb.cs
- _ShellExpression.cs
- MethodAccessException.cs
- OrderPreservingMergeHelper.cs
- smtpconnection.cs
- NativeRecognizer.cs
- RelationshipEntry.cs
- ButtonAutomationPeer.cs
- AutomationPattern.cs
- RC2.cs
- UnhandledExceptionEventArgs.cs
- AutomationPatternInfo.cs
- ListenerHandler.cs
- EndOfStreamException.cs
- SettingsContext.cs
- Rijndael.cs
- GridViewHeaderRowPresenter.cs
- TargetParameterCountException.cs
- ReceiveMessageContent.cs
- RuntimeHandles.cs
- ControlAdapter.cs
- SkipStoryboardToFill.cs
- ArgumentDesigner.xaml.cs
- ObjectStateManager.cs
- ImageDrawing.cs
- ParameterModifier.cs
- XmlSchemaCollection.cs
- FormViewInsertEventArgs.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- FrameworkRichTextComposition.cs
- WindowsEditBox.cs
- TreeNodeClickEventArgs.cs
- CngUIPolicy.cs
- Line.cs
- SHA1.cs
- CodeTypeReference.cs
- ConfigurationManagerInternalFactory.cs
- GorillaCodec.cs
- EventLogPermissionAttribute.cs
- CodeAttributeDeclarationCollection.cs
- UncommonField.cs
- OleDbException.cs
- _ConnectStream.cs
- WizardForm.cs
- ManualResetEvent.cs
- WmpBitmapEncoder.cs
- SerializableAttribute.cs
- DefaultWorkflowTransactionService.cs
- CompilationLock.cs
- Compiler.cs
- X509CertificateStore.cs
- PackWebResponse.cs
- MemberRelationshipService.cs
- AspCompat.cs
- NonParentingControl.cs
- LinearGradientBrush.cs
- PenLineCapValidation.cs
- SystemIPv4InterfaceProperties.cs
- StringSource.cs
- StateDesigner.LayoutSelectionGlyph.cs
- HtmlTitle.cs
- XPathSingletonIterator.cs
- AttachedAnnotationChangedEventArgs.cs
- Pen.cs
- PublishLicense.cs