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
- DispatchOperationRuntime.cs
- ByeOperation11AsyncResult.cs
- FileDialogCustomPlace.cs
- Regex.cs
- ColorKeyFrameCollection.cs
- ExtendedPropertyDescriptor.cs
- ImageSourceConverter.cs
- OdbcConnectionFactory.cs
- CompiledQuery.cs
- MatrixUtil.cs
- PeerUnsafeNativeMethods.cs
- ListViewPagedDataSource.cs
- LassoSelectionBehavior.cs
- GetPageCompletedEventArgs.cs
- RandomDelayQueuedSendsAsyncResult.cs
- Sql8ConformanceChecker.cs
- CodeSnippetExpression.cs
- SmtpSection.cs
- Int32AnimationBase.cs
- DataSvcMapFileSerializer.cs
- HttpConfigurationSystem.cs
- __Error.cs
- ComponentCollection.cs
- EncoderBestFitFallback.cs
- MetadataItemSerializer.cs
- MouseButtonEventArgs.cs
- SetIterators.cs
- CursorConverter.cs
- SqlBulkCopy.cs
- LoginName.cs
- SpeechSeg.cs
- WindowsListViewSubItem.cs
- DiscardableAttribute.cs
- DynamicResourceExtension.cs
- SQLString.cs
- XmlReader.cs
- ImageBrush.cs
- SqlNodeAnnotations.cs
- MemberInitExpression.cs
- FormViewDeletedEventArgs.cs
- IDQuery.cs
- ItemList.cs
- DropSourceBehavior.cs
- Membership.cs
- MediaElement.cs
- WorkflowInstanceContextProvider.cs
- TrackingMemoryStream.cs
- EpmTargetTree.cs
- MoveSizeWinEventHandler.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- StyleModeStack.cs
- Html32TextWriter.cs
- XmlObjectSerializerReadContextComplexJson.cs
- MulticastOption.cs
- IisTraceWebEventProvider.cs
- WindowsProgressbar.cs
- BaseAsyncResult.cs
- TransformerInfoCollection.cs
- RadialGradientBrush.cs
- LayoutEditorPart.cs
- ButtonStandardAdapter.cs
- ShadowGlyph.cs
- HtmlContainerControl.cs
- AffineTransform3D.cs
- Barrier.cs
- PersonalizationState.cs
- TableLayoutCellPaintEventArgs.cs
- ControlBuilder.cs
- safex509handles.cs
- OleDbCommand.cs
- XPathDocumentNavigator.cs
- DateTimeOffsetConverter.cs
- AttachedPropertyBrowsableAttribute.cs
- DataControlFieldsEditor.cs
- GeneralTransform3DGroup.cs
- ConfigDefinitionUpdates.cs
- CodeDirectoryCompiler.cs
- _SecureChannel.cs
- ErrorHandlerFaultInfo.cs
- LinkLabelLinkClickedEvent.cs
- LogReserveAndAppendState.cs
- SystemColors.cs
- DataGridHeaderBorder.cs
- PersonalizationStateInfoCollection.cs
- StrongNameIdentityPermission.cs
- IteratorFilter.cs
- SimpleExpression.cs
- MeasureItemEvent.cs
- ConstNode.cs
- CodeMethodInvokeExpression.cs
- DataGridViewMethods.cs
- HostedTcpTransportManager.cs
- AsyncWaitHandle.cs
- DefaultSerializationProviderAttribute.cs
- PageParserFilter.cs
- TextServicesDisplayAttributePropertyRanges.cs
- FileDetails.cs
- PromptEventArgs.cs
- SurrogateSelector.cs
- EntityKey.cs