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
- XamlStream.cs
- HtmlTernaryTree.cs
- CapabilitiesRule.cs
- NameScope.cs
- PerformanceCounterPermissionEntryCollection.cs
- FocusWithinProperty.cs
- StrokeCollection.cs
- ComplexPropertyEntry.cs
- XsdDuration.cs
- SafeProcessHandle.cs
- ILGen.cs
- ContextMenuService.cs
- PropertyItem.cs
- IsolatedStoragePermission.cs
- DataGridTextBoxColumn.cs
- DeferredTextReference.cs
- OdbcDataAdapter.cs
- HttpProfileBase.cs
- storepermission.cs
- Separator.cs
- JulianCalendar.cs
- SqlCommand.cs
- PrintPageEvent.cs
- XmlComment.cs
- SiteMapDataSourceView.cs
- ActivityInterfaces.cs
- FilteredXmlReader.cs
- ActivityPreviewDesigner.cs
- StringOutput.cs
- MultipartContentParser.cs
- StructuredTypeInfo.cs
- xdrvalidator.cs
- HtmlInputSubmit.cs
- FieldTemplateUserControl.cs
- CacheDependency.cs
- SoapRpcMethodAttribute.cs
- ListViewDeletedEventArgs.cs
- ellipse.cs
- ProfileService.cs
- Formatter.cs
- WebMessageEncodingElement.cs
- MetadataResolver.cs
- ArraySubsetEnumerator.cs
- NotCondition.cs
- WebPart.cs
- StringFreezingAttribute.cs
- RowBinding.cs
- HttpListenerRequest.cs
- ExpressionServices.cs
- ResourceDisplayNameAttribute.cs
- MessageDirection.cs
- ContainerSelectorActiveEvent.cs
- ArrayConverter.cs
- ReflectTypeDescriptionProvider.cs
- ZipIOExtraFieldElement.cs
- ColumnWidthChangingEvent.cs
- ACL.cs
- DbConnectionPoolOptions.cs
- KeyConstraint.cs
- AddInContractAttribute.cs
- ListItemConverter.cs
- WebServiceHandlerFactory.cs
- DependencyPropertyConverter.cs
- XmlExtensionFunction.cs
- TextBlock.cs
- HierarchicalDataBoundControl.cs
- SystemResourceHost.cs
- AutomationAttributeInfo.cs
- AssociationTypeEmitter.cs
- RegexCode.cs
- Button.cs
- ProxyWebPartManager.cs
- VirtualizedCellInfoCollection.cs
- TreeBuilder.cs
- Page.cs
- StoreAnnotationsMap.cs
- ObjectDataSourceSelectingEventArgs.cs
- RSAPKCS1KeyExchangeFormatter.cs
- QilDataSource.cs
- Variable.cs
- EntityParameter.cs
- GroupLabel.cs
- KeyedCollection.cs
- CachingHintValidation.cs
- XPathDescendantIterator.cs
- TextTreeExtractElementUndoUnit.cs
- Line.cs
- TraceRecord.cs
- PropertyEntry.cs
- Attribute.cs
- EventToken.cs
- HebrewNumber.cs
- ListViewGroupCollectionEditor.cs
- ArraySubsetEnumerator.cs
- SQLDecimal.cs
- ObjectViewQueryResultData.cs
- ZipIOFileItemStream.cs
- ContentPropertyAttribute.cs
- PathGradientBrush.cs
- Terminate.cs