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
- SimpleApplicationHost.cs
- ConstructorArgumentAttribute.cs
- AnonymousIdentificationModule.cs
- AuthenticationException.cs
- XMLSchema.cs
- DrawingImage.cs
- RepeaterDataBoundAdapter.cs
- SoapServerMethod.cs
- SignatureConfirmations.cs
- NativeMethods.cs
- AspNetRouteServiceHttpHandler.cs
- DocumentOutline.cs
- Int64AnimationUsingKeyFrames.cs
- Processor.cs
- SamlAuthorizationDecisionClaimResource.cs
- SystemIcmpV4Statistics.cs
- OleDbDataAdapter.cs
- XmlTextReaderImplHelpers.cs
- XmlSchemaElement.cs
- ApplicationFileParser.cs
- CollectionBase.cs
- RectAnimationClockResource.cs
- UnknownBitmapDecoder.cs
- MetadataItemCollectionFactory.cs
- UserNameSecurityTokenProvider.cs
- DataListItem.cs
- PanningMessageFilter.cs
- ListDictionary.cs
- SafeFileMappingHandle.cs
- MasterPageBuildProvider.cs
- Atom10FormatterFactory.cs
- FontSource.cs
- CustomError.cs
- IriParsingElement.cs
- OdbcReferenceCollection.cs
- InvokeGenerator.cs
- SingleSelectRootGridEntry.cs
- ZipIOLocalFileBlock.cs
- XPathAncestorIterator.cs
- SqlReferenceCollection.cs
- AsyncInvokeContext.cs
- ConstructorNeedsTagAttribute.cs
- ColorConvertedBitmap.cs
- Simplifier.cs
- ReliabilityContractAttribute.cs
- ObjectStateEntryDbDataRecord.cs
- GlyphManager.cs
- XappLauncher.cs
- InvokeHandlers.cs
- SmiSettersStream.cs
- ControlType.cs
- Grant.cs
- SHA512Cng.cs
- HandleCollector.cs
- FileUtil.cs
- SmiXetterAccessMap.cs
- Int32AnimationUsingKeyFrames.cs
- TextSimpleMarkerProperties.cs
- TextViewElement.cs
- TitleStyle.cs
- FixedFlowMap.cs
- basecomparevalidator.cs
- UriWriter.cs
- RelationshipDetailsRow.cs
- Substitution.cs
- TagMapInfo.cs
- ComponentTray.cs
- WorkflowStateRollbackService.cs
- WebRequest.cs
- SafeCryptoHandles.cs
- Int64.cs
- EventSinkHelperWriter.cs
- TaskFileService.cs
- ServiceEndpointElementCollection.cs
- XmlBoundElement.cs
- PartialTrustHelpers.cs
- TimelineGroup.cs
- DataGridViewSortCompareEventArgs.cs
- ConfigXmlAttribute.cs
- ListControl.cs
- MappingSource.cs
- RequiredAttributeAttribute.cs
- PropertyKey.cs
- Emitter.cs
- HelloMessage11.cs
- unitconverter.cs
- IIS7UserPrincipal.cs
- TcpChannelFactory.cs
- MouseWheelEventArgs.cs
- IndexingContentUnit.cs
- TextUtf8RawTextWriter.cs
- IpcChannelHelper.cs
- SharedConnectionWorkflowTransactionService.cs
- PropertyValueUIItem.cs
- ReflectionServiceProvider.cs
- WindowsStartMenu.cs
- SafePEFileHandle.cs
- DrawingContextWalker.cs
- DefaultWorkflowLoaderService.cs
- securestring.cs