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
- FlowDecisionLabelFeature.cs
- TagPrefixCollection.cs
- dataSvcMapFileLoader.cs
- GridViewPageEventArgs.cs
- ActivityBindForm.cs
- XmlSchemaSimpleContentExtension.cs
- SvcMapFileLoader.cs
- RoleManagerModule.cs
- LifetimeManager.cs
- ListViewGroupCollectionEditor.cs
- RNGCryptoServiceProvider.cs
- PropertyMapper.cs
- FontDialog.cs
- PageClientProxyGenerator.cs
- CharUnicodeInfo.cs
- CustomValidator.cs
- NavigateEvent.cs
- GenericEnumConverter.cs
- SizeValueSerializer.cs
- DataGrid.cs
- SchemaImporterExtension.cs
- SmtpNegotiateAuthenticationModule.cs
- BaseResourcesBuildProvider.cs
- InternalTransaction.cs
- DetailsViewDesigner.cs
- ModifiableIteratorCollection.cs
- EntityDataSourceContainerNameConverter.cs
- CompressionTransform.cs
- RectIndependentAnimationStorage.cs
- SchemaEntity.cs
- WebBrowserUriTypeConverter.cs
- PasswordBoxAutomationPeer.cs
- SourceItem.cs
- AccessedThroughPropertyAttribute.cs
- FixedDSBuilder.cs
- DecimalConverter.cs
- PointCollection.cs
- DynamicControl.cs
- WebMessageEncodingBindingElement.cs
- BrowserDefinition.cs
- _AutoWebProxyScriptWrapper.cs
- SystemColorTracker.cs
- Buffer.cs
- ColumnCollection.cs
- BoolExpr.cs
- ProjectedSlot.cs
- ConfigUtil.cs
- XappLauncher.cs
- AnnotationHighlightLayer.cs
- RTLAwareMessageBox.cs
- EventLogPermission.cs
- SchemaImporterExtension.cs
- KnownTypesHelper.cs
- RelativeSource.cs
- ParallelTimeline.cs
- BufferedReadStream.cs
- RealizationContext.cs
- ServiceSecurityAuditElement.cs
- ResizeGrip.cs
- SqlStream.cs
- BuildTopDownAttribute.cs
- FileRegion.cs
- CompositeScriptReference.cs
- SqlBulkCopyColumnMapping.cs
- RemotingConfigParser.cs
- DataGridViewCellFormattingEventArgs.cs
- uribuilder.cs
- ThicknessKeyFrameCollection.cs
- SessionStateModule.cs
- QuinticEase.cs
- DBSqlParserColumn.cs
- LiteralControl.cs
- DuplicateWaitObjectException.cs
- BaseDataListPage.cs
- AmbientLight.cs
- CardSpaceSelector.cs
- HtmlLabelAdapter.cs
- SessionStateContainer.cs
- nulltextnavigator.cs
- HtmlButton.cs
- GeneralTransform3DGroup.cs
- StatusBarDrawItemEvent.cs
- XmlChoiceIdentifierAttribute.cs
- SafeNativeMethods.cs
- CachedBitmap.cs
- VerticalAlignConverter.cs
- ExecutorLocksHeldException.cs
- FileLevelControlBuilderAttribute.cs
- FamilyCollection.cs
- DataObject.cs
- FilterableAttribute.cs
- InheritanceRules.cs
- SolidBrush.cs
- SHA384.cs
- ConnectorEditor.cs
- WindowsTab.cs
- FusionWrap.cs
- MetadataArtifactLoader.cs
- Dictionary.cs
- HeaderElement.cs