Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / TextTreePropertyUndoUnit.cs / 1305600 / TextTreePropertyUndoUnit.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Undo unit for TextContainer.SetValue, etc. calls. // // History: // 03/03/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using MS.Internal; namespace System.Windows.Documents { // Undo unit for TextContainer.SetValue, etc. calls. internal class TextTreePropertyUndoUnit : TextTreeUndoUnit { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Create a new undo unit instance. // symbolOffset is where property values will be set. internal TextTreePropertyUndoUnit(TextContainer tree, int symbolOffset, PropertyRecord propertyRecord) : base(tree, symbolOffset) { _propertyRecord = propertyRecord; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods // Called by the undo manager. Restores tree state to its condition // when the unit was created. Assumes the tree state matches conditions // just after the unit was created. public override void DoCore() { TextPointer position; VerifyTreeContentHashCode(); position = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, "TextTree undo unit out of [....] with TextTree."); if (_propertyRecord.Value != DependencyProperty.UnsetValue) { this.TextContainer.SetValue(position, _propertyRecord.Property, _propertyRecord.Value); } else { position.Parent.ClearValue(_propertyRecord.Property); } } #endregion Public Methods //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ #region Private Fields // Property/value pair to restore. private readonly PropertyRecord _propertyRecord; #endregion Private Fields } } // 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
- CreateRefExpr.cs
- DesignerView.Commands.cs
- RepeatButtonAutomationPeer.cs
- BrushValueSerializer.cs
- RSAPKCS1SignatureDeformatter.cs
- CachedPathData.cs
- TdsParserHelperClasses.cs
- ZoomPercentageConverter.cs
- BaseTemplateParser.cs
- AutomationFocusChangedEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- ProfilePropertySettingsCollection.cs
- FederatedMessageSecurityOverHttpElement.cs
- XmlReflectionImporter.cs
- MenuAutoFormat.cs
- ThreadNeutralSemaphore.cs
- WebMessageFormatHelper.cs
- TextRangeEditTables.cs
- PriorityBinding.cs
- ExceptionRoutedEventArgs.cs
- PlatformNotSupportedException.cs
- KeyboardNavigation.cs
- HttpRequest.cs
- CatalogPartCollection.cs
- VBIdentifierNameEditor.cs
- ExecutorLocksHeldException.cs
- PerfCounters.cs
- XmlDigitalSignatureProcessor.cs
- Cell.cs
- WindowsTreeView.cs
- SortAction.cs
- PropertyToken.cs
- Span.cs
- EditorPartCollection.cs
- GeneralTransformCollection.cs
- XmlSchemaException.cs
- MaskedTextBoxDesigner.cs
- X500Name.cs
- XmlSchemaInferenceException.cs
- Single.cs
- DataListCommandEventArgs.cs
- DbConnectionFactory.cs
- SeekStoryboard.cs
- RepeaterItem.cs
- WebBrowser.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- StringValidator.cs
- ChameleonKey.cs
- InteropAutomationProvider.cs
- XPathAncestorQuery.cs
- BinHexEncoding.cs
- CodeMemberMethod.cs
- DesignerActionUIService.cs
- TypeUtils.cs
- FlowLayout.cs
- LicFileLicenseProvider.cs
- AsyncCodeActivity.cs
- AnnotationObservableCollection.cs
- WebBrowserBase.cs
- WindowsTreeView.cs
- GridViewUpdateEventArgs.cs
- ViewStateModeByIdAttribute.cs
- VBIdentifierNameEditor.cs
- RuntimeResourceSet.cs
- StoreItemCollection.Loader.cs
- PolicyStatement.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- HandlerFactoryWrapper.cs
- ActivityDesignerResources.cs
- Stylesheet.cs
- DropTarget.cs
- InlineObject.cs
- TypeLoadException.cs
- DocumentPageView.cs
- MsmqAppDomainProtocolHandler.cs
- PointAnimationUsingPath.cs
- DataGridViewCellCancelEventArgs.cs
- Events.cs
- ConnectionStringsExpressionBuilder.cs
- XmlDownloadManager.cs
- SymbolTable.cs
- EntityDataSourceColumn.cs
- TableChangeProcessor.cs
- GatewayIPAddressInformationCollection.cs
- SqlSupersetValidator.cs
- FlowDocumentReader.cs
- CompositeFontFamily.cs
- SerTrace.cs
- TrustSection.cs
- OdbcCommand.cs
- WebBrowser.cs
- coordinator.cs
- MemberAssignmentAnalysis.cs
- ReferencedType.cs
- CodeNamespaceCollection.cs
- SqlMetaData.cs
- ListParagraph.cs
- TreeViewImageIndexConverter.cs
- ZoneButton.cs
- IpcPort.cs