Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------- // 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
- SessionIDManager.cs
- ObjectStateManagerMetadata.cs
- ObjectSelectorEditor.cs
- ApplicationManager.cs
- SuppressMergeCheckAttribute.cs
- RepeatInfo.cs
- DropDownList.cs
- ECDiffieHellmanCng.cs
- XmlDataLoader.cs
- StringValidatorAttribute.cs
- XamlPointCollectionSerializer.cs
- PersistencePipeline.cs
- ReceiveParametersContent.cs
- XmlUTF8TextReader.cs
- SchemaImporter.cs
- MonthCalendar.cs
- pingexception.cs
- LinqDataSourceSelectEventArgs.cs
- TextRangeSerialization.cs
- DateTimeParse.cs
- Exceptions.cs
- CellQuery.cs
- Interlocked.cs
- StorageComplexTypeMapping.cs
- GroupPartitionExpr.cs
- SdlChannelSink.cs
- EntitySetRetriever.cs
- SystemIPv4InterfaceProperties.cs
- EnumerableCollectionView.cs
- JsonDataContract.cs
- ToolStrip.cs
- TreeViewHitTestInfo.cs
- Encoding.cs
- LongCountAggregationOperator.cs
- ReadContentAsBinaryHelper.cs
- TaiwanLunisolarCalendar.cs
- UpdatableGenericsFeature.cs
- COM2PropertyBuilderUITypeEditor.cs
- XmlILIndex.cs
- MimeMultiPart.cs
- HGlobalSafeHandle.cs
- XmlSchemaSimpleTypeUnion.cs
- XmlSchemaImporter.cs
- EdmSchemaAttribute.cs
- EdgeModeValidation.cs
- Pair.cs
- IApplicationTrustManager.cs
- SQLBytes.cs
- Identifier.cs
- CFStream.cs
- HtmlLink.cs
- MatrixAnimationBase.cs
- Interlocked.cs
- InstanceCreationEditor.cs
- HostProtectionException.cs
- LocalizationParserHooks.cs
- RuntimeHandles.cs
- SplineQuaternionKeyFrame.cs
- MaskedTextBox.cs
- ObfuscationAttribute.cs
- HMACSHA1.cs
- BufferModeSettings.cs
- StrokeCollectionConverter.cs
- SQLString.cs
- BinarySerializer.cs
- ExpressionLink.cs
- XmlDataSourceNodeDescriptor.cs
- HtmlUtf8RawTextWriter.cs
- RouteParameter.cs
- TypeReference.cs
- shaperfactory.cs
- PeerInvitationResponse.cs
- iisPickupDirectory.cs
- codemethodreferenceexpression.cs
- LinkedResourceCollection.cs
- PathFigureCollection.cs
- CmsUtils.cs
- SpecialNameAttribute.cs
- SeverityFilter.cs
- ISCIIEncoding.cs
- Line.cs
- _ListenerRequestStream.cs
- TranslateTransform3D.cs
- ServiceSecurityAuditBehavior.cs
- TableCell.cs
- ListControl.cs
- CanonicalizationDriver.cs
- HTTPNotFoundHandler.cs
- UniqueIdentifierService.cs
- ServiceOperationInvoker.cs
- CancellationTokenSource.cs
- AliasGenerator.cs
- ConfigurationPropertyCollection.cs
- SafeNativeMethods.cs
- DataTrigger.cs
- IPEndPoint.cs
- XPathNavigator.cs
- ISFTagAndGuidCache.cs
- CalendarDay.cs
- Array.cs