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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlNavigatorStack.cs
- COAUTHIDENTITY.cs
- PrintPageEvent.cs
- SelectionListDesigner.cs
- HorizontalAlignConverter.cs
- VersionPair.cs
- WpfXamlType.cs
- QueryOptionExpression.cs
- DataMemberListEditor.cs
- GridViewRowEventArgs.cs
- StateMachineDesignerPaint.cs
- UntypedNullExpression.cs
- NamespaceList.cs
- GZipUtils.cs
- ZipFileInfo.cs
- ClientScriptManager.cs
- XmlDictionaryReader.cs
- SslStream.cs
- CodeCatchClauseCollection.cs
- MediaElementAutomationPeer.cs
- SqlBulkCopy.cs
- ColumnPropertiesGroup.cs
- CellParaClient.cs
- TextBoxBase.cs
- ImageIndexEditor.cs
- IdentityNotMappedException.cs
- DbXmlEnabledProviderManifest.cs
- PrintDialog.cs
- EnvelopedPkcs7.cs
- TokenDescriptor.cs
- MaterialGroup.cs
- EntityTypeEmitter.cs
- ComponentCollection.cs
- Assembly.cs
- StrictAndMessageFilter.cs
- RunWorkerCompletedEventArgs.cs
- SecureEnvironment.cs
- MediaElementAutomationPeer.cs
- DataBoundControlActionList.cs
- _HeaderInfoTable.cs
- BaseParser.cs
- NameValueConfigurationElement.cs
- HttpModulesSection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SiteMapPath.cs
- WindowsScroll.cs
- PlacementWorkspace.cs
- EventLogTraceListener.cs
- BitmapCodecInfoInternal.cs
- Expression.cs
- RootDesignerSerializerAttribute.cs
- MenuItemCollectionEditor.cs
- RenderDataDrawingContext.cs
- SetterBaseCollection.cs
- CodeDelegateInvokeExpression.cs
- RsaSecurityTokenAuthenticator.cs
- GifBitmapDecoder.cs
- Missing.cs
- PinnedBufferMemoryStream.cs
- ProfessionalColors.cs
- BamlBinaryReader.cs
- StylusShape.cs
- ResolveMatchesMessageCD1.cs
- ContentAlignmentEditor.cs
- FixedSOMPageConstructor.cs
- UITypeEditor.cs
- FormViewPagerRow.cs
- DesignerTextBoxAdapter.cs
- DrawingGroup.cs
- TemplateControlParser.cs
- FontWeights.cs
- RangeValuePatternIdentifiers.cs
- ParserHooks.cs
- AssemblyCacheEntry.cs
- CatalogZoneBase.cs
- SystemWebCachingSectionGroup.cs
- ListBoxChrome.cs
- DynamicValueConverter.cs
- XmlSchemaAll.cs
- HttpModuleAction.cs
- MetroSerializationManager.cs
- DataGridViewCellStyleChangedEventArgs.cs
- HtmlControlPersistable.cs
- Ref.cs
- XmlValueConverter.cs
- GlobalItem.cs
- TextRange.cs
- OperationInfoBase.cs
- AppliedDeviceFiltersDialog.cs
- CheckBox.cs
- HtmlShimManager.cs
- InputScopeAttribute.cs
- COM2FontConverter.cs
- ISessionStateStore.cs
- SiteMapPathDesigner.cs
- TreeWalkHelper.cs
- LayoutDump.cs
- GreaterThan.cs
- MapPathBasedVirtualPathProvider.cs
- TableLayoutPanel.cs