Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / ColumnResizeUndoUnit.cs / 1 / ColumnResizeUndoUnit.cs
//---------------------------------------------------------------------------- // // File: ColumnResizeUndoUnit.cs // // Description: Undo unit for resizing columns // // History: // 01/27/2005 : [....] - 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
- XmlSchemaAttribute.cs
- ResourceReader.cs
- PeerChannelFactory.cs
- Composition.cs
- DatePickerAutomationPeer.cs
- BooleanStorage.cs
- FileRegion.cs
- MachineKey.cs
- DLinqAssociationProvider.cs
- XmlCollation.cs
- ToolStripButton.cs
- LinkArea.cs
- SQLMembershipProvider.cs
- RequestCachePolicy.cs
- DependencyPropertyValueSerializer.cs
- SystemResourceKey.cs
- DataGridColumnHeadersPresenter.cs
- SqlClientPermission.cs
- UriTemplateClientFormatter.cs
- XPathDescendantIterator.cs
- CryptoStream.cs
- RelationshipDetailsCollection.cs
- Condition.cs
- Splitter.cs
- ArithmeticException.cs
- CorrelationHandle.cs
- XmlException.cs
- TabControlCancelEvent.cs
- GenericsInstances.cs
- XmlSignificantWhitespace.cs
- RegistryPermission.cs
- ListView.cs
- StringResourceManager.cs
- PropertyDescriptorComparer.cs
- ZipIOExtraFieldElement.cs
- SimpleExpression.cs
- HttpWebRequest.cs
- TcpAppDomainProtocolHandler.cs
- DragEvent.cs
- ChannelTerminatedException.cs
- AuthorizationContext.cs
- DocumentPage.cs
- TextUtf8RawTextWriter.cs
- RoutedEventArgs.cs
- AccessibilityApplicationManager.cs
- HtmlControl.cs
- GCHandleCookieTable.cs
- DynamicContractTypeBuilder.cs
- HttpResponse.cs
- TransformedBitmap.cs
- TableColumn.cs
- MembershipAdapter.cs
- ToolStripActionList.cs
- DescendantQuery.cs
- ScriptingScriptResourceHandlerSection.cs
- StringStorage.cs
- RpcAsyncResult.cs
- ConfigXmlElement.cs
- COAUTHINFO.cs
- TreeNodeConverter.cs
- ToolboxItemCollection.cs
- IntegerCollectionEditor.cs
- Mappings.cs
- StringDictionary.cs
- HighlightVisual.cs
- ChannelManager.cs
- StringFunctions.cs
- CharEnumerator.cs
- DragDropHelper.cs
- RemoteWebConfigurationHost.cs
- ExecutionEngineException.cs
- HttpPostedFileWrapper.cs
- AppSettingsExpressionBuilder.cs
- CompilationLock.cs
- ScrollData.cs
- PackageProperties.cs
- TableLayoutPanelBehavior.cs
- PositiveTimeSpanValidator.cs
- DataGridTableCollection.cs
- ScriptingWebServicesSectionGroup.cs
- FreezableDefaultValueFactory.cs
- SafeProcessHandle.cs
- MDIClient.cs
- EmptyControlCollection.cs
- OrderByBuilder.cs
- SizeChangedInfo.cs
- XmlNamespaceManager.cs
- XmlSchemaExternal.cs
- AssemblyHash.cs
- Pts.cs
- ReferentialConstraint.cs
- OracleRowUpdatedEventArgs.cs
- OrderPreservingPipeliningSpoolingTask.cs
- ModulesEntry.cs
- ClientTargetSection.cs
- InputLanguageCollection.cs
- returneventsaver.cs
- CompilationUtil.cs
- GenericAuthenticationEventArgs.cs
- DataGridViewTextBoxCell.cs