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
- ScriptMethodAttribute.cs
- CodeEntryPointMethod.cs
- ColorConverter.cs
- PrtCap_Public_Simple.cs
- XmlSchemaSimpleContent.cs
- VerificationAttribute.cs
- PasswordRecovery.cs
- UntypedNullExpression.cs
- LinkButton.cs
- OdbcEnvironment.cs
- Style.cs
- ValueQuery.cs
- InstanceNameConverter.cs
- StrokeCollection2.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- Avt.cs
- GreenMethods.cs
- IssuanceLicense.cs
- DockAndAnchorLayout.cs
- BamlLocalizationDictionary.cs
- RowTypeElement.cs
- OneToOneMappingSerializer.cs
- WebPartConnectionsConfigureVerb.cs
- GestureRecognitionResult.cs
- NetTcpSecurity.cs
- NullableBoolConverter.cs
- GuidelineCollection.cs
- TextBoxBase.cs
- FontConverter.cs
- AnnotationResourceCollection.cs
- RewritingSimplifier.cs
- UnsafeNativeMethods.cs
- SoapCodeExporter.cs
- _ListenerAsyncResult.cs
- Solver.cs
- WindowsFormsHostAutomationPeer.cs
- MultiSelectRootGridEntry.cs
- XPathNavigatorKeyComparer.cs
- UriTemplateClientFormatter.cs
- ScriptServiceAttribute.cs
- TreeNodeCollection.cs
- ProtocolsConfigurationEntry.cs
- PixelFormat.cs
- ModelItemImpl.cs
- Utility.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- BinaryOperationBinder.cs
- SchemaNames.cs
- SqlXml.cs
- GeneralTransform.cs
- TemplateColumn.cs
- RepeaterCommandEventArgs.cs
- ListItemCollection.cs
- CodeMethodReturnStatement.cs
- formatstringdialog.cs
- OrderedDictionary.cs
- WebReferencesBuildProvider.cs
- PageBuildProvider.cs
- DoubleAnimationBase.cs
- NullReferenceException.cs
- ProjectedSlot.cs
- SizeChangedEventArgs.cs
- SqlPersonalizationProvider.cs
- FontFamilyValueSerializer.cs
- FixedSOMTableCell.cs
- TypeGeneratedEventArgs.cs
- SrgsItemList.cs
- DefaultExpression.cs
- Storyboard.cs
- DesignerDataTableBase.cs
- PerformanceCounterPermissionEntry.cs
- AccessDataSourceView.cs
- CompoundFileStorageReference.cs
- AsynchronousChannel.cs
- InternalControlCollection.cs
- ImageSource.cs
- TreeViewImageIndexConverter.cs
- XmlHierarchyData.cs
- OletxDependentTransaction.cs
- ToolStripItemClickedEventArgs.cs
- FastEncoderWindow.cs
- PrefixHandle.cs
- DelegateBodyWriter.cs
- UIElementPropertyUndoUnit.cs
- Line.cs
- CardSpacePolicyElement.cs
- MarginCollapsingState.cs
- TypeConverterBase.cs
- WinInet.cs
- MsmqIntegrationSecurityElement.cs
- SafeProcessHandle.cs
- JournalNavigationScope.cs
- Point4DConverter.cs
- TaskFactory.cs
- MulticastOption.cs
- Color.cs
- IIS7UserPrincipal.cs
- SplitterPanel.cs
- TableLayoutSettingsTypeConverter.cs
- OracleConnectionStringBuilder.cs