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
- GuidConverter.cs
- VerbConverter.cs
- SqlCacheDependency.cs
- CodeLabeledStatement.cs
- ViewCellRelation.cs
- UnsupportedPolicyOptionsException.cs
- ChineseLunisolarCalendar.cs
- TextBoxLine.cs
- PenContexts.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ReflectionUtil.cs
- ContextMenuStrip.cs
- SmiMetaData.cs
- EdgeProfileValidation.cs
- RoleGroup.cs
- DelegateHelpers.Generated.cs
- FileUpload.cs
- EncoderBestFitFallback.cs
- LowerCaseStringConverter.cs
- SpAudioStreamWrapper.cs
- FlowchartSizeFeature.cs
- MultipartContentParser.cs
- CredentialCache.cs
- ChangeNode.cs
- StrokeRenderer.cs
- BindingManagerDataErrorEventArgs.cs
- DateTimeSerializationSection.cs
- TypeUtil.cs
- BaseResourcesBuildProvider.cs
- PopupRootAutomationPeer.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SizeConverter.cs
- TypeSystemHelpers.cs
- FolderBrowserDialog.cs
- PrintDialog.cs
- ChtmlSelectionListAdapter.cs
- TrackingProfileSerializer.cs
- SchemaRegistration.cs
- GacUtil.cs
- WindowManager.cs
- KeyGestureConverter.cs
- CodeIdentifier.cs
- HitTestDrawingContextWalker.cs
- MailAddressParser.cs
- DataStorage.cs
- invalidudtexception.cs
- DataGridViewTextBoxEditingControl.cs
- TypeGeneratedEventArgs.cs
- WebHeaderCollection.cs
- DocumentsTrace.cs
- VirtualDirectoryMappingCollection.cs
- StreamGeometry.cs
- DesignerDataTable.cs
- DataGridCellInfo.cs
- TextSyndicationContent.cs
- DbParameterCollectionHelper.cs
- followingquery.cs
- ReflectionPermission.cs
- ToolStripItemClickedEventArgs.cs
- CharacterString.cs
- BitmapPalettes.cs
- DataObjectSettingDataEventArgs.cs
- XPathNodeHelper.cs
- ApplicationFileCodeDomTreeGenerator.cs
- PeerCollaborationPermission.cs
- XslTransformFileEditor.cs
- XamlGridLengthSerializer.cs
- MultiByteCodec.cs
- SortedSetDebugView.cs
- LingerOption.cs
- DirectoryInfo.cs
- ErrorWrapper.cs
- SqlWebEventProvider.cs
- Boolean.cs
- StringBuilder.cs
- ApplicationFileCodeDomTreeGenerator.cs
- QueryStatement.cs
- Rect3D.cs
- TextRangeEditTables.cs
- SatelliteContractVersionAttribute.cs
- MenuScrollingVisibilityConverter.cs
- Timer.cs
- DesignSurfaceServiceContainer.cs
- DesignerVerb.cs
- PropertyCondition.cs
- SocketElement.cs
- ProxyHwnd.cs
- OperandQuery.cs
- DataGridViewCellConverter.cs
- WebPart.cs
- FeatureSupport.cs
- TextDecoration.cs
- RawAppCommandInputReport.cs
- InputLanguageProfileNotifySink.cs
- ScriptRegistrationManager.cs
- EventSetter.cs
- DataGridViewTextBoxCell.cs
- FormViewPagerRow.cs
- ExpressionBindingCollection.cs
- ListDesigner.cs