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
- QilPatternVisitor.cs
- WebSysDescriptionAttribute.cs
- SettingsPropertyValue.cs
- DataTableNewRowEvent.cs
- PageVisual.cs
- MessageSecurityOverMsmqElement.cs
- ArcSegment.cs
- HierarchicalDataBoundControl.cs
- DataBinder.cs
- GridViewCommandEventArgs.cs
- documentsequencetextview.cs
- StandardCommandToolStripMenuItem.cs
- InputBindingCollection.cs
- CustomError.cs
- Matrix.cs
- MaterialGroup.cs
- ACE.cs
- DataObjectMethodAttribute.cs
- Partitioner.cs
- ProcessThread.cs
- IxmlLineInfo.cs
- ValueUtilsSmi.cs
- TargetControlTypeAttribute.cs
- TaskForm.cs
- AssemblyInfo.cs
- LinearGradientBrush.cs
- HandlerBase.cs
- Floater.cs
- ZipPackage.cs
- AuthenticationException.cs
- GraphicsContainer.cs
- MissingMemberException.cs
- Compiler.cs
- nulltextnavigator.cs
- PeerConnector.cs
- TextEditorTables.cs
- QilSortKey.cs
- DiagnosticStrings.cs
- SmiEventSink.cs
- ButtonColumn.cs
- FormViewPagerRow.cs
- DocumentPageHost.cs
- ProxyDataContractResolver.cs
- BasicHttpBindingElement.cs
- DefaultAssemblyResolver.cs
- XPathParser.cs
- SafeMemoryMappedViewHandle.cs
- IDQuery.cs
- TransactionFlowOption.cs
- FormsAuthenticationUserCollection.cs
- TearOffProxy.cs
- UpDownEvent.cs
- ConfigXmlText.cs
- RSAPKCS1SignatureDeformatter.cs
- TreeNodeCollection.cs
- WebMessageEncodingElement.cs
- ErrorFormatterPage.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- DataKey.cs
- MenuItem.cs
- NameValuePermission.cs
- KeyConverter.cs
- ProjectionPathSegment.cs
- DXD.cs
- DynamicDataManager.cs
- OperatorExpressions.cs
- RequestTimeoutManager.cs
- VScrollBar.cs
- LabelEditEvent.cs
- HttpBufferlessInputStream.cs
- ManagedWndProcTracker.cs
- MessageUtil.cs
- SoapSchemaImporter.cs
- SerTrace.cs
- EntityProviderFactory.cs
- ValidationError.cs
- PaintEvent.cs
- HashCodeCombiner.cs
- AssociationProvider.cs
- Peer.cs
- WindowsListViewGroup.cs
- RecognitionResult.cs
- PropertyFilterAttribute.cs
- XmlUtil.cs
- OdbcConnection.cs
- DataGridViewColumnHeaderCell.cs
- DataGridTableCollection.cs
- InternalDispatchObject.cs
- HandoffBehavior.cs
- TimeStampChecker.cs
- DataTableCollection.cs
- TextSelectionHighlightLayer.cs
- Confirm.cs
- RoutedEvent.cs
- OracleTimeSpan.cs
- HtmlImage.cs
- InvokePattern.cs
- ComponentRenameEvent.cs
- CellIdBoolean.cs
- UInt64Converter.cs