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
- EventItfInfo.cs
- ErrorHandlerModule.cs
- WebPartCollection.cs
- WindowsSecurityToken.cs
- MissingFieldException.cs
- RequestCachePolicy.cs
- SignatureResourcePool.cs
- Message.cs
- ImpersonateTokenRef.cs
- WebBrowserNavigatedEventHandler.cs
- MetabaseServerConfig.cs
- WebPartExportVerb.cs
- SimpleHandlerFactory.cs
- CfgParser.cs
- SelectedDatesCollection.cs
- DetailsViewDeleteEventArgs.cs
- FixedStringLookup.cs
- PrinterSettings.cs
- TwoPhaseCommit.cs
- XmlFormatWriterGenerator.cs
- ActivityMarkupSerializationProvider.cs
- dtdvalidator.cs
- ProxySimple.cs
- templategroup.cs
- BufferModeSettings.cs
- SqlIdentifier.cs
- GeometryModel3D.cs
- InstalledFontCollection.cs
- DoubleCollection.cs
- DataGridViewButtonCell.cs
- ToolboxItemAttribute.cs
- BindingCollection.cs
- HtmlSelect.cs
- CharConverter.cs
- TextDecorationCollection.cs
- OledbConnectionStringbuilder.cs
- MouseButtonEventArgs.cs
- Variable.cs
- SHA256.cs
- RuleAction.cs
- ControlPropertyNameConverter.cs
- ScrollContentPresenter.cs
- precedingsibling.cs
- EntityConnectionStringBuilder.cs
- GridViewRowEventArgs.cs
- ChineseLunisolarCalendar.cs
- StylusButton.cs
- SimpleHandlerFactory.cs
- BaseTemplateParser.cs
- TransformedBitmap.cs
- UnionCqlBlock.cs
- IpcClientManager.cs
- DuplicateWaitObjectException.cs
- DesignerResources.cs
- ExpressionBuilderContext.cs
- PropertyGridView.cs
- VectorKeyFrameCollection.cs
- _PooledStream.cs
- BaseCollection.cs
- HelpKeywordAttribute.cs
- AsymmetricKeyExchangeFormatter.cs
- HtmlElementEventArgs.cs
- HighlightComponent.cs
- AutomationAttributeInfo.cs
- Cursor.cs
- DataGridViewCellCancelEventArgs.cs
- ToolStripButton.cs
- SmiContext.cs
- AssertHelper.cs
- MD5CryptoServiceProvider.cs
- RootBrowserWindow.cs
- JournalEntryStack.cs
- DataGridRelationshipRow.cs
- ToolStripLocationCancelEventArgs.cs
- SqlConnectionPoolGroupProviderInfo.cs
- WindowsStartMenu.cs
- FileAuthorizationModule.cs
- SchemeSettingElement.cs
- PasswordBoxAutomationPeer.cs
- EventListener.cs
- KoreanCalendar.cs
- Visual.cs
- Contracts.cs
- PolyQuadraticBezierSegment.cs
- x509store.cs
- ProviderUtil.cs
- listitem.cs
- ObjectQueryProvider.cs
- MD5.cs
- Page.cs
- GenericWebPart.cs
- HtmlLink.cs
- Pen.cs
- OrderedDictionaryStateHelper.cs
- Duration.cs
- PerspectiveCamera.cs
- TextEditor.cs
- PanningMessageFilter.cs
- HtmlInputButton.cs
- XmlSchemaExternal.cs