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
- DataRelationPropertyDescriptor.cs
- SourceFileBuildProvider.cs
- SystemIcons.cs
- Padding.cs
- Axis.cs
- FunctionNode.cs
- AbsoluteQuery.cs
- ConditionalExpression.cs
- QilXmlReader.cs
- MemoryMappedView.cs
- NameSpaceExtractor.cs
- SQLString.cs
- TranslateTransform.cs
- DPTypeDescriptorContext.cs
- ListenerElementsCollection.cs
- PropertyManager.cs
- TextViewBase.cs
- FontEmbeddingManager.cs
- XamlParser.cs
- HandlerFactoryCache.cs
- ViewBox.cs
- DependencyPropertyKey.cs
- TransformProviderWrapper.cs
- WindowsGrip.cs
- RuntimeConfig.cs
- UniqueContractNameValidationBehavior.cs
- SchemaNames.cs
- CodeExporter.cs
- SortedList.cs
- ObjectItemCollection.cs
- RegistryKey.cs
- PrivilegedConfigurationManager.cs
- DbConnectionStringCommon.cs
- IISMapPath.cs
- TableCellCollection.cs
- WebConfigurationHost.cs
- ContextStaticAttribute.cs
- SafeBitVector32.cs
- FormViewRow.cs
- SubMenuStyleCollection.cs
- EmptyStringExpandableObjectConverter.cs
- ContextStaticAttribute.cs
- IndexedEnumerable.cs
- Empty.cs
- ExpressionDumper.cs
- SafeNativeMethods.cs
- GraphicsState.cs
- SqlConnectionString.cs
- DataGridColumnStyleMappingNameEditor.cs
- RtfFormatStack.cs
- PenLineJoinValidation.cs
- DefinitionProperties.cs
- SQLInt16.cs
- MimeBasePart.cs
- Variant.cs
- StatusBarItem.cs
- CompareValidator.cs
- CustomTrackingRecord.cs
- EventlogProvider.cs
- DataViewManagerListItemTypeDescriptor.cs
- CompositeActivityCodeGenerator.cs
- DynamicValueConverter.cs
- ScriptingSectionGroup.cs
- SrgsElement.cs
- MessageProtectionOrder.cs
- DataGridViewSelectedRowCollection.cs
- Size3D.cs
- IndentedWriter.cs
- Condition.cs
- ServicePoint.cs
- BamlLocalizationDictionary.cs
- RegisteredHiddenField.cs
- ResourcesChangeInfo.cs
- HttpListenerException.cs
- LinearKeyFrames.cs
- HttpAsyncResult.cs
- Point3DAnimation.cs
- MenuItemStyle.cs
- InputLanguageSource.cs
- StringValueSerializer.cs
- InternalConfigRoot.cs
- TrustSection.cs
- Ipv6Element.cs
- DataColumnMappingCollection.cs
- StringValidator.cs
- HttpCacheVaryByContentEncodings.cs
- OleDbConnection.cs
- SocketException.cs
- JumpList.cs
- ByteStorage.cs
- DiffuseMaterial.cs
- InkPresenter.cs
- Cursor.cs
- ReaderWriterLockWrapper.cs
- XmlILStorageConverter.cs
- SQLConvert.cs
- CapabilitiesAssignment.cs
- WebBrowserEvent.cs
- PathSegment.cs
- UrlEncodedParameterWriter.cs