Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClusterRegistryConfigurationProvider.cs
- _IPv4Address.cs
- FileSystemEventArgs.cs
- TextProperties.cs
- BaseDataList.cs
- GridViewDeleteEventArgs.cs
- UIElementPropertyUndoUnit.cs
- StrokeCollection2.cs
- ObjectViewFactory.cs
- ProjectionRewriter.cs
- XmlSerializerVersionAttribute.cs
- DetailsViewRow.cs
- BinaryFormatterWriter.cs
- IriParsingElement.cs
- ACE.cs
- WindowHideOrCloseTracker.cs
- SizeF.cs
- MSHTMLHostUtil.cs
- TreeIterators.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- RegistryKey.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- RealizedColumnsBlock.cs
- ResourceDescriptionAttribute.cs
- WindowsRichEdit.cs
- XamlReaderHelper.cs
- SQlBooleanStorage.cs
- TimeSpanMinutesConverter.cs
- MessageAction.cs
- GroupBox.cs
- ToolStripPanel.cs
- ModifierKeysValueSerializer.cs
- LicenseManager.cs
- GridErrorDlg.cs
- DataControlLinkButton.cs
- TargetControlTypeCache.cs
- ObjectDisposedException.cs
- QilTypeChecker.cs
- BackStopAuthenticationModule.cs
- BitStack.cs
- FactoryRecord.cs
- BufferedGraphicsManager.cs
- UndoManager.cs
- MimeAnyImporter.cs
- OleDbConnectionInternal.cs
- Renderer.cs
- DataGridViewColumn.cs
- ValidationErrorCollection.cs
- ConfigPathUtility.cs
- Listbox.cs
- TemplateBamlRecordReader.cs
- CatalogPartChrome.cs
- PtsCache.cs
- Animatable.cs
- ObjectDataSourceView.cs
- UrlAuthFailureHandler.cs
- SettingsBase.cs
- UIElement3D.cs
- AssemblyInfo.cs
- ZipIOFileItemStream.cs
- InvokePattern.cs
- Line.cs
- BuildProvider.cs
- Renderer.cs
- RemoveStoryboard.cs
- XmlCompatibilityReader.cs
- TypeDelegator.cs
- ScriptingJsonSerializationSection.cs
- PackageDigitalSignatureManager.cs
- SmiSettersStream.cs
- FontInfo.cs
- XmlNamespaceDeclarationsAttribute.cs
- MenuBase.cs
- SystemInformation.cs
- HwndAppCommandInputProvider.cs
- WindowsFont.cs
- ColorConverter.cs
- RootDesignerSerializerAttribute.cs
- HtmlWindow.cs
- ReceiveContent.cs
- SystemThemeKey.cs
- RenderData.cs
- HideDisabledControlAdapter.cs
- TagMapInfo.cs
- CommandField.cs
- StringUtil.cs
- ResXResourceReader.cs
- Trustee.cs
- AstTree.cs
- SponsorHelper.cs
- ObjectDataProvider.cs
- SID.cs
- ControlCollection.cs
- DataGridViewComboBoxCell.cs
- DbProviderManifest.cs
- MimeTypeAttribute.cs
- BaseUriHelper.cs
- DataGridViewMethods.cs
- PageParser.cs
- RangeValidator.cs