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
- RoleServiceManager.cs
- WebHttpDispatchOperationSelector.cs
- PathSegmentCollection.cs
- ObjectRef.cs
- ApplicationSecurityManager.cs
- TargetFrameworkUtil.cs
- CompensationTokenData.cs
- XmlSerializerNamespaces.cs
- TreeNodeEventArgs.cs
- Globals.cs
- ResourcesBuildProvider.cs
- DataGridViewTopLeftHeaderCell.cs
- TextClipboardData.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataException.cs
- TextLineResult.cs
- LinqDataSourceDisposeEventArgs.cs
- InputBinder.cs
- SecurityKeyEntropyMode.cs
- Trace.cs
- DataControlFieldCell.cs
- ClientOptions.cs
- XamlContextStack.cs
- PackWebRequestFactory.cs
- datacache.cs
- ServiceParser.cs
- TextAdaptor.cs
- WindowsUpDown.cs
- SwitchAttribute.cs
- ExpressionLexer.cs
- TextTreeTextBlock.cs
- XhtmlTextWriter.cs
- GridItem.cs
- ParseElement.cs
- WSTransactionSection.cs
- path.cs
- RegisteredHiddenField.cs
- TriggerAction.cs
- RIPEMD160Managed.cs
- Accessible.cs
- ClientApiGenerator.cs
- Int32CollectionConverter.cs
- ThreadAbortException.cs
- SecurityAlgorithmSuiteConverter.cs
- Vector3DConverter.cs
- Number.cs
- IntellisenseTextBox.designer.cs
- PersonalizablePropertyEntry.cs
- SoapIncludeAttribute.cs
- DataGridViewRowEventArgs.cs
- AsynchronousChannelMergeEnumerator.cs
- TextParaClient.cs
- TimerEventSubscription.cs
- PenLineJoinValidation.cs
- TraceXPathNavigator.cs
- CodeTypeConstructor.cs
- SiteMapNodeItem.cs
- RefreshPropertiesAttribute.cs
- InputBindingCollection.cs
- AutomationEvent.cs
- ExtendedPropertyInfo.cs
- LedgerEntry.cs
- DtrList.cs
- CharKeyFrameCollection.cs
- PropertyPathWorker.cs
- BaseComponentEditor.cs
- WebPartDisplayModeCancelEventArgs.cs
- AutomationTextAttribute.cs
- iisPickupDirectory.cs
- SqlBulkCopy.cs
- XmlWriterDelegator.cs
- NavigatorInvalidBodyAccessException.cs
- ValidationErrorEventArgs.cs
- BrowserTree.cs
- DriveInfo.cs
- Crypto.cs
- DataGridViewElement.cs
- Vector3DConverter.cs
- KeyTimeConverter.cs
- FontCacheUtil.cs
- UnsafeNetInfoNativeMethods.cs
- NullableIntAverageAggregationOperator.cs
- DispatcherSynchronizationContext.cs
- DrawingGroup.cs
- WebHttpDispatchOperationSelector.cs
- DateTimeOffsetAdapter.cs
- PbrsForward.cs
- StrokeCollection2.cs
- TemplatePartAttribute.cs
- DesignSurfaceServiceContainer.cs
- MenuScrollingVisibilityConverter.cs
- MetaModel.cs
- ApplicationContext.cs
- RSAOAEPKeyExchangeFormatter.cs
- BindingNavigator.cs
- SchemaComplexType.cs
- controlskin.cs
- ResXDataNode.cs
- HwndKeyboardInputProvider.cs
- OdbcParameterCollection.cs