Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / EditingScopeUndoUnit.cs / 1305376 / EditingScopeUndoUnit.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System; using System.Collections.Generic; using System.Text; using System.Activities.Presentation.View; using System.Activities.Presentation.Model; class EditingScopeUndoUnit : UndoUnit { ModelTreeManager modelTreeManager; EditingScope editingScope; WorkflowDesigner workflowDesigner; public EditingScopeUndoUnit(WorkflowDesigner workflowDesigner, ModelTreeManager modelTreeManager, EditingScope editingScope) : base(workflowDesigner.Context) { this.workflowDesigner = workflowDesigner; this.modelTreeManager = modelTreeManager; this.editingScope = editingScope; this.Description = this.editingScope.Description; SaveGlobalState(); } public override void Redo() { this.modelTreeManager.StopTracking(); EditingScope redoEditingScope = this.modelTreeManager.CreateEditingScope(this.editingScope.Description); redoEditingScope.Changes.AddRange(editingScope.Changes); redoEditingScope.Complete(); this.modelTreeManager.StartTracking(); ApplyGlobalState(); } public override void Undo() { this.modelTreeManager.StopTracking(); EditingScope undoEditingScope = this.modelTreeManager.CreateEditingScope(this.editingScope.Description); foreach (Change change in editingScope.Changes) { Change inverseChange = change.GetInverse(); if (inverseChange != null) { undoEditingScope.Changes.Add(inverseChange); } } undoEditingScope.Changes.Reverse(); undoEditingScope.Complete(); this.modelTreeManager.StartTracking(); ApplyGlobalState(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- baseaxisquery.cs
- DisplayMemberTemplateSelector.cs
- XmlSchemaInfo.cs
- VideoDrawing.cs
- PointAnimationUsingKeyFrames.cs
- TogglePatternIdentifiers.cs
- SAPICategories.cs
- User.cs
- FilteredAttributeCollection.cs
- SQLBoolean.cs
- ScrollViewerAutomationPeer.cs
- Variable.cs
- Assert.cs
- MaskedTextBox.cs
- QuerySetOp.cs
- DataSetViewSchema.cs
- ElementProxy.cs
- LocalizationComments.cs
- TablePattern.cs
- EUCJPEncoding.cs
- AbstractDataSvcMapFileLoader.cs
- FixedPageAutomationPeer.cs
- Camera.cs
- SamlAuthenticationClaimResource.cs
- InstanceDataCollection.cs
- XmlSchemaCollection.cs
- GlyphsSerializer.cs
- RegexCompiler.cs
- DWriteFactory.cs
- DeflateInput.cs
- indexingfiltermarshaler.cs
- ChangeInterceptorAttribute.cs
- TextContainer.cs
- ListViewGroupConverter.cs
- KnownAssembliesSet.cs
- ProcessInfo.cs
- Model3DCollection.cs
- DataReaderContainer.cs
- PostBackOptions.cs
- GPPOINT.cs
- Regex.cs
- ToolStripTextBox.cs
- XhtmlTextWriter.cs
- ScriptingAuthenticationServiceSection.cs
- ObjectDataSourceView.cs
- RowBinding.cs
- ListViewContainer.cs
- HistoryEventArgs.cs
- SetStoryboardSpeedRatio.cs
- LinkedList.cs
- DataViewSettingCollection.cs
- NamespaceMapping.cs
- TaskDesigner.cs
- TrackBar.cs
- CapabilitiesSection.cs
- PathTooLongException.cs
- XPathConvert.cs
- ComplexObject.cs
- Oid.cs
- ZipIOModeEnforcingStream.cs
- CompositeFontParser.cs
- DataGridViewComponentPropertyGridSite.cs
- PolyBezierSegmentFigureLogic.cs
- DecimalConstantAttribute.cs
- InputMethodStateTypeInfo.cs
- ResourcePermissionBaseEntry.cs
- PersianCalendar.cs
- Splitter.cs
- cryptoapiTransform.cs
- NamedPipeProcessProtocolHandler.cs
- HttpMethodAttribute.cs
- DragDeltaEventArgs.cs
- WebServiceResponse.cs
- OwnerDrawPropertyBag.cs
- DrawItemEvent.cs
- LogSwitch.cs
- TreeViewItemAutomationPeer.cs
- X509Extension.cs
- SkipQueryOptionExpression.cs
- ArrayTypeMismatchException.cs
- RegexReplacement.cs
- CustomExpressionEventArgs.cs
- InternalBufferManager.cs
- DependencyObjectProvider.cs
- RegexCode.cs
- FontStretch.cs
- CharacterShapingProperties.cs
- Stack.cs
- PaperSize.cs
- SingleObjectCollection.cs
- DocumentCollection.cs
- FormViewRow.cs
- SystemIPInterfaceStatistics.cs
- DispatcherTimer.cs
- AnimationLayer.cs
- RemoteCryptoTokenProvider.cs
- SimpleBitVector32.cs
- RichTextBoxConstants.cs
- ConnectorRouter.cs
- SafeRegistryHandle.cs