Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Documents / TextTreePropertyUndoUnit.cs / 1 / TextTreePropertyUndoUnit.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Undo unit for TextContainer.SetValue, etc. calls. // // History: // 03/03/2004 : benwest - 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. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Undo unit for TextContainer.SetValue, etc. calls. // // History: // 03/03/2004 : benwest - 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextStack.cs
- StylusPointProperty.cs
- SiteMapDesignerDataSourceView.cs
- ReadOnlyPermissionSet.cs
- ProcessThread.cs
- SeekStoryboard.cs
- KeyValuePairs.cs
- PersonalizationEntry.cs
- WorkflowWebService.cs
- LabelLiteral.cs
- CompareValidator.cs
- CriticalHandle.cs
- StringWriter.cs
- DBSchemaTable.cs
- BaseValidator.cs
- IOThreadScheduler.cs
- Subordinate.cs
- PolicyLevel.cs
- ComponentSerializationService.cs
- MDIControlStrip.cs
- SafeFileMappingHandle.cs
- KerberosSecurityTokenAuthenticator.cs
- SqlBulkCopy.cs
- PropertyValueUIItem.cs
- MessageBox.cs
- LicFileLicenseProvider.cs
- MetadataException.cs
- CompositeActivityTypeDescriptor.cs
- TabPage.cs
- WebPartManager.cs
- ShaderEffect.cs
- ItemsControl.cs
- ClientCultureInfo.cs
- DeferredBinaryDeserializerExtension.cs
- ExpandedWrapper.cs
- SimpleWorkerRequest.cs
- DbProviderFactories.cs
- CodeGen.cs
- PromptEventArgs.cs
- ScrollViewer.cs
- TransformCollection.cs
- GridViewActionList.cs
- BaseProcessProtocolHandler.cs
- Span.cs
- TextRange.cs
- ExpressionBuilder.cs
- TraversalRequest.cs
- DataError.cs
- ContentPresenter.cs
- PartialCachingAttribute.cs
- PathNode.cs
- FieldTemplateUserControl.cs
- _AutoWebProxyScriptEngine.cs
- ToolboxService.cs
- InternalCache.cs
- SessionSwitchEventArgs.cs
- CodeAttachEventStatement.cs
- PersonalizationAdministration.cs
- SafeWaitHandle.cs
- AssemblyFilter.cs
- EdmSchemaError.cs
- RsaSecurityToken.cs
- TCPListener.cs
- Stack.cs
- RepeaterItemEventArgs.cs
- wmiprovider.cs
- NavigationHelper.cs
- TraceUtility.cs
- altserialization.cs
- PropertyRef.cs
- ClientType.cs
- HtmlInputHidden.cs
- TableCellAutomationPeer.cs
- SmiRequestExecutor.cs
- CodeAttributeDeclaration.cs
- CompiledRegexRunner.cs
- OdbcCommandBuilder.cs
- TraceListener.cs
- ConditionalAttribute.cs
- SegmentInfo.cs
- XmlTypeAttribute.cs
- StreamDocument.cs
- CaseInsensitiveComparer.cs
- util.cs
- ConfigXmlElement.cs
- KeyedHashAlgorithm.cs
- DataRowChangeEvent.cs
- AuthenticationManager.cs
- SqlUtils.cs
- CryptoConfig.cs
- NegotiateStream.cs
- CompareValidator.cs
- FragmentNavigationEventArgs.cs
- ProbeMatchesMessage11.cs
- ConnectionPointCookie.cs
- SizeAnimationUsingKeyFrames.cs
- ButtonPopupAdapter.cs
- PersonalizableAttribute.cs
- SqlLiftIndependentRowExpressions.cs
- AuthStoreRoleProvider.cs