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
- CapabilitiesSection.cs
- ServiceObjectContainer.cs
- LoggedException.cs
- WmlObjectListAdapter.cs
- WorkflowView.cs
- UIntPtr.cs
- SmtpLoginAuthenticationModule.cs
- QuerySelectOp.cs
- SharedHttpsTransportManager.cs
- QuaternionAnimation.cs
- OfTypeExpression.cs
- RenderCapability.cs
- MessageAction.cs
- TransactionScope.cs
- XmlSchemaCompilationSettings.cs
- BaseAppDomainProtocolHandler.cs
- DataBinder.cs
- ArrayElementGridEntry.cs
- XamlVector3DCollectionSerializer.cs
- FontConverter.cs
- EdmItemCollection.cs
- Attributes.cs
- WebDisplayNameAttribute.cs
- CompilationRelaxations.cs
- MLangCodePageEncoding.cs
- RepeaterItemEventArgs.cs
- DockPattern.cs
- CorruptingExceptionCommon.cs
- BaseTemplateCodeDomTreeGenerator.cs
- Pen.cs
- SpecialTypeDataContract.cs
- PageTheme.cs
- XamlInt32CollectionSerializer.cs
- TypeToTreeConverter.cs
- EntityEntry.cs
- DesignerTransactionCloseEvent.cs
- QuadraticBezierSegment.cs
- ExecutionContext.cs
- MarshalByRefObject.cs
- PageHandlerFactory.cs
- TrackingQuery.cs
- DataGridViewTextBoxEditingControl.cs
- designeractionbehavior.cs
- AdPostCacheSubstitution.cs
- SpecularMaterial.cs
- DecimalAnimation.cs
- AssemblyBuilder.cs
- Scene3D.cs
- SafeEventLogWriteHandle.cs
- GorillaCodec.cs
- XmlILTrace.cs
- TextServicesProperty.cs
- DataSourceXmlElementAttribute.cs
- CodeNamespace.cs
- SiteMapHierarchicalDataSourceView.cs
- StorageMappingItemLoader.cs
- ExtensionSimplifierMarkupObject.cs
- CapacityStreamGeometryContext.cs
- TreeIterator.cs
- IEnumerable.cs
- TriggerCollection.cs
- CharKeyFrameCollection.cs
- DbConnectionStringBuilder.cs
- ColorAnimation.cs
- PackageProperties.cs
- XmlReflectionMember.cs
- WizardPanel.cs
- ToolboxBitmapAttribute.cs
- DesigntimeLicenseContextSerializer.cs
- ListMarkerSourceInfo.cs
- PrivilegeNotHeldException.cs
- FlatButtonAppearance.cs
- ClipboardData.cs
- InstancePersistenceException.cs
- CardSpacePolicyElement.cs
- ControllableStoryboardAction.cs
- Array.cs
- DbReferenceCollection.cs
- ProxyGenerator.cs
- ServicePoint.cs
- DispatchChannelSink.cs
- BitmapSizeOptions.cs
- XmlHierarchicalDataSourceView.cs
- XmlReader.cs
- ZoneButton.cs
- webeventbuffer.cs
- RoutedEventConverter.cs
- StatusBarPanelClickEvent.cs
- InternalTypeHelper.cs
- basenumberconverter.cs
- TypeLibConverter.cs
- TableAutomationPeer.cs
- CombinedGeometry.cs
- HotSpotCollection.cs
- QueryStringParameter.cs
- TemplateBamlRecordReader.cs
- HistoryEventArgs.cs
- PrivilegeNotHeldException.cs
- DataTableClearEvent.cs
- ScrollEventArgs.cs