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
- RewritingSimplifier.cs
- Wildcard.cs
- CfgParser.cs
- WorkflowDefinitionDispenser.cs
- SudsParser.cs
- CallInfo.cs
- BatchWriter.cs
- Vector3DConverter.cs
- SoundPlayer.cs
- SspiHelper.cs
- PropertyIDSet.cs
- BindUriHelper.cs
- CompilationPass2Task.cs
- xsdvalidator.cs
- Adorner.cs
- SqlDataSourceEnumerator.cs
- Stopwatch.cs
- Evidence.cs
- CorruptingExceptionCommon.cs
- EntityContainerEmitter.cs
- SqlTopReducer.cs
- ContextMenu.cs
- ObjectViewEntityCollectionData.cs
- MultiBindingExpression.cs
- ContainerUIElement3D.cs
- ComboBoxRenderer.cs
- BaseAppDomainProtocolHandler.cs
- SocketPermission.cs
- RuntimeResourceSet.cs
- XpsFilter.cs
- ImportContext.cs
- ProxyFragment.cs
- NotifyIcon.cs
- SafeLibraryHandle.cs
- ListBoxAutomationPeer.cs
- XPathNodeHelper.cs
- BaseInfoTable.cs
- IDataContractSurrogate.cs
- HtmlToClrEventProxy.cs
- Assembly.cs
- DescendentsWalker.cs
- PaperSource.cs
- ReadContentAsBinaryHelper.cs
- StreamReader.cs
- XPathDocumentIterator.cs
- ObjectViewQueryResultData.cs
- EntityDesignerUtils.cs
- localization.cs
- RouteValueExpressionBuilder.cs
- AuthenticationModulesSection.cs
- IDictionary.cs
- TreeBuilderBamlTranslator.cs
- FieldAccessException.cs
- WebBrowserSiteBase.cs
- latinshape.cs
- HasActivatableWorkflowEvent.cs
- MessageQueueEnumerator.cs
- SchemaCollectionPreprocessor.cs
- FileSecurity.cs
- HostProtectionException.cs
- DiscoveryClientChannelBase.cs
- AstNode.cs
- CacheChildrenQuery.cs
- AuthenticatedStream.cs
- GeneralTransform.cs
- OverflowException.cs
- ExecutionEngineException.cs
- FileChangeNotifier.cs
- DesignerProperties.cs
- FontCollection.cs
- OleDbFactory.cs
- StaticTextPointer.cs
- LineProperties.cs
- DocumentViewerConstants.cs
- CqlParserHelpers.cs
- WebPartHeaderCloseVerb.cs
- Buffer.cs
- RayMeshGeometry3DHitTestResult.cs
- ObjectIDGenerator.cs
- QueryLifecycle.cs
- SmtpLoginAuthenticationModule.cs
- NullExtension.cs
- SymbolUsageManager.cs
- IconConverter.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- FormParameter.cs
- URLMembershipCondition.cs
- ProviderSettingsCollection.cs
- StyleModeStack.cs
- FunctionQuery.cs
- AssemblyInfo.cs
- GridViewSelectEventArgs.cs
- InputLanguageProfileNotifySink.cs
- FlowDocumentPage.cs
- ThaiBuddhistCalendar.cs
- WindowClosedEventArgs.cs
- TransformerConfigurationWizardBase.cs
- HttpsChannelFactory.cs
- PrePrepareMethodAttribute.cs
- StylusShape.cs