Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / UndoUnit.cs / 1305376 / UndoUnit.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; public abstract class UndoUnit { EditingContext context; ModelItem designerRoot; public string Description { get; set; } public abstract void Redo(); public abstract void Undo(); protected UndoUnit(EditingContext context) { if (context == null) { throw FxTrace.Exception.AsError(new ArgumentNullException("context")); } this.context = context; } protected void SaveGlobalState() { DesignerView designerView = context.Services.GetService(); if (designerView != null && designerView.RootDesigner != null) { designerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem; } } protected void ApplyGlobalState() { DesignerView designerView = context.Services.GetService (); if (designerView != null && designerView.RootDesigner != null) { ModelItem currentDesignerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem; if (currentDesignerRoot != designerRoot) { designerView.MakeRootDesigner(designerRoot); } } } } } // 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; public abstract class UndoUnit { EditingContext context; ModelItem designerRoot; public string Description { get; set; } public abstract void Redo(); public abstract void Undo(); protected UndoUnit(EditingContext context) { if (context == null) { throw FxTrace.Exception.AsError(new ArgumentNullException("context")); } this.context = context; } protected void SaveGlobalState() { DesignerView designerView = context.Services.GetService (); if (designerView != null && designerView.RootDesigner != null) { designerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem; } } protected void ApplyGlobalState() { DesignerView designerView = context.Services.GetService (); if (designerView != null && designerView.RootDesigner != null) { ModelItem currentDesignerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem; if (currentDesignerRoot != designerRoot) { designerView.MakeRootDesigner(designerRoot); } } } } } // 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
- ZoomPercentageConverter.cs
- RootBuilder.cs
- IgnoreSectionHandler.cs
- GradientStop.cs
- RegexMatch.cs
- ScalarConstant.cs
- ZipIOLocalFileDataDescriptor.cs
- MissingFieldException.cs
- MessageDecoder.cs
- DbDataRecord.cs
- RtfNavigator.cs
- ButtonBase.cs
- SemaphoreSecurity.cs
- NavigationProgressEventArgs.cs
- InternalConfigSettingsFactory.cs
- IImplicitResourceProvider.cs
- OfTypeExpression.cs
- Span.cs
- ExtensibleSyndicationObject.cs
- ModuleBuilder.cs
- EntityContainerEntitySet.cs
- HttpProfileBase.cs
- InstalledFontCollection.cs
- DocumentReferenceCollection.cs
- MatrixTransform3D.cs
- Vector3dCollection.cs
- DataPagerField.cs
- MemoryMappedViewAccessor.cs
- CapabilitiesPattern.cs
- StickyNoteContentControl.cs
- HttpRequest.cs
- _Events.cs
- DataGridViewRowsRemovedEventArgs.cs
- AnimationException.cs
- SqlDataSourceSelectingEventArgs.cs
- SqlBulkCopyColumnMappingCollection.cs
- AsyncResult.cs
- TraceSource.cs
- ControlIdConverter.cs
- Rule.cs
- AssemblyResourceLoader.cs
- InteropEnvironment.cs
- AspNetCompatibilityRequirementsAttribute.cs
- MenuItemCollection.cs
- SqlBulkCopyColumnMapping.cs
- X509SecurityToken.cs
- Soap.cs
- MonitoringDescriptionAttribute.cs
- ArrayConverter.cs
- GridViewColumnHeader.cs
- WsdlParser.cs
- DataServiceQueryException.cs
- MultilineStringEditor.cs
- Parser.cs
- NetworkAddressChange.cs
- RuntimeEnvironment.cs
- EventsTab.cs
- DataColumnCollection.cs
- SHA512Managed.cs
- ConditionalAttribute.cs
- HttpResponse.cs
- ExceptionAggregator.cs
- HttpRuntimeSection.cs
- ContainerActivationHelper.cs
- StorageRoot.cs
- TableLayoutPanel.cs
- RemotingServices.cs
- MgmtResManager.cs
- Int32AnimationBase.cs
- TextTreeTextNode.cs
- XhtmlBasicLabelAdapter.cs
- AdRotator.cs
- ErrorHandler.cs
- DataGridViewColumnConverter.cs
- MetafileHeader.cs
- FormViewPagerRow.cs
- SoapReflectionImporter.cs
- TabPageDesigner.cs
- DesignerRegionMouseEventArgs.cs
- XPathDocument.cs
- HttpWebResponse.cs
- MimeTextImporter.cs
- ToolStripItemRenderEventArgs.cs
- documentsequencetextview.cs
- MessageQueuePermissionAttribute.cs
- VolatileEnlistmentState.cs
- DateRangeEvent.cs
- EmptyEnumerator.cs
- CryptoStream.cs
- GotoExpression.cs
- HtmlTextViewAdapter.cs
- FormsAuthenticationUserCollection.cs
- basecomparevalidator.cs
- TaskFormBase.cs
- VisualBrush.cs
- IpcChannelHelper.cs
- DeclaredTypeElement.cs
- TextMarkerSource.cs
- PartitionedStream.cs
- MediaContext.cs