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
- RightsManagementPermission.cs
- FrameSecurityDescriptor.cs
- KerberosSecurityTokenProvider.cs
- CachedPathData.cs
- Internal.cs
- MetadataArtifactLoaderComposite.cs
- XDeferredAxisSource.cs
- BaseParagraph.cs
- ClientUtils.cs
- ToolboxItemAttribute.cs
- PageOutputColor.cs
- WebSysDefaultValueAttribute.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DBCommandBuilder.cs
- nulltextcontainer.cs
- SQLBinary.cs
- ConnectionStringsExpressionBuilder.cs
- EntityDataSourceConfigureObjectContext.cs
- XmlUtf8RawTextWriter.cs
- LocalValueEnumerator.cs
- ObjRef.cs
- DesignerActionPropertyItem.cs
- WaveHeader.cs
- XmlSchemaAnnotated.cs
- EdmTypeAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- SmtpReplyReaderFactory.cs
- SimpleType.cs
- AssemblyCache.cs
- CheckBoxRenderer.cs
- SiteMapNodeItem.cs
- TextEditorThreadLocalStore.cs
- ContentFilePart.cs
- UIntPtr.cs
- TypeSystemProvider.cs
- querybuilder.cs
- SSmlParser.cs
- EventEntry.cs
- SystemIcmpV4Statistics.cs
- XmlStringTable.cs
- NetStream.cs
- LambdaCompiler.cs
- MethodBody.cs
- LassoSelectionBehavior.cs
- GatewayDefinition.cs
- DataBinder.cs
- RichTextBoxConstants.cs
- SecurityTokenReferenceStyle.cs
- PresentationSource.cs
- EncryptedPackageFilter.cs
- SqlInternalConnectionSmi.cs
- ListQueryResults.cs
- SignatureHelper.cs
- SourceChangedEventArgs.cs
- ControlCachePolicy.cs
- SignatureToken.cs
- TextBlockAutomationPeer.cs
- Pointer.cs
- RegionData.cs
- ListDictionaryInternal.cs
- DbgUtil.cs
- WorkflowRuntimeEndpoint.cs
- EntryWrittenEventArgs.cs
- SyndicationDeserializer.cs
- AsynchronousChannelMergeEnumerator.cs
- PreviewPrintController.cs
- PackagingUtilities.cs
- WebPartExportVerb.cs
- CommandField.cs
- CustomAttributeBuilder.cs
- SqlLiftWhereClauses.cs
- ObjectQueryState.cs
- Site.cs
- ApplicationTrust.cs
- RoleManagerModule.cs
- BrowserTree.cs
- CharEnumerator.cs
- OdbcCommand.cs
- BuildResult.cs
- BeginEvent.cs
- PageSetupDialog.cs
- ColumnTypeConverter.cs
- ClassHandlersStore.cs
- XmlWriter.cs
- ExtendedProperty.cs
- TextRunTypographyProperties.cs
- ConfigurationProperty.cs
- WebHttpBindingElement.cs
- Debug.cs
- QueryExpression.cs
- TempFiles.cs
- DatePickerTextBox.cs
- Collection.cs
- Vector3dCollection.cs
- SimpleRecyclingCache.cs
- CachedPathData.cs
- SocketException.cs
- BinaryReader.cs
- BypassElementCollection.cs
- ApplicationProxyInternal.cs