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
- Logging.cs
- ProjectionCamera.cs
- WebControlAdapter.cs
- LogStream.cs
- SoapExtensionImporter.cs
- DiagnosticsConfiguration.cs
- QilInvokeLateBound.cs
- RuleSettings.cs
- TextSelectionProcessor.cs
- WebCodeGenerator.cs
- SymbolType.cs
- ErrorTableItemStyle.cs
- ExceptionUtil.cs
- SessionIDManager.cs
- EdmToObjectNamespaceMap.cs
- SortQuery.cs
- PropertyNames.cs
- MessageBox.cs
- RequestCachePolicyConverter.cs
- CodeParameterDeclarationExpression.cs
- WebPartUserCapability.cs
- ToggleButtonAutomationPeer.cs
- ExpandCollapsePatternIdentifiers.cs
- ThaiBuddhistCalendar.cs
- mda.cs
- XPathExpr.cs
- ConnectionConsumerAttribute.cs
- KeyNameIdentifierClause.cs
- HttpAsyncResult.cs
- InternalTypeHelper.cs
- TiffBitmapEncoder.cs
- ListViewGroup.cs
- QilValidationVisitor.cs
- PolyQuadraticBezierSegment.cs
- XsltFunctions.cs
- ApplicationSecurityInfo.cs
- OracleRowUpdatingEventArgs.cs
- CodeVariableReferenceExpression.cs
- localization.cs
- UnaryQueryOperator.cs
- LocalClientSecuritySettingsElement.cs
- UInt16.cs
- Buffer.cs
- SmtpReplyReaderFactory.cs
- XmlSchemaResource.cs
- DesignerLabelAdapter.cs
- ProfileBuildProvider.cs
- _NestedMultipleAsyncResult.cs
- WindowsListViewGroup.cs
- SqlCacheDependency.cs
- TextEditorContextMenu.cs
- NetworkCredential.cs
- ConfigXmlWhitespace.cs
- ContentControl.cs
- ComponentManagerBroker.cs
- Array.cs
- XPathExpr.cs
- IsolatedStoragePermission.cs
- BuildManager.cs
- CallSiteOps.cs
- ViewCellSlot.cs
- ObjectListTitleAttribute.cs
- TraceSwitch.cs
- Baml2006ReaderFrame.cs
- EntitySetDataBindingList.cs
- _IPv6Address.cs
- Vector3DAnimationUsingKeyFrames.cs
- DbConnectionHelper.cs
- __ComObject.cs
- AxImporter.cs
- XmlNode.cs
- ConsoleKeyInfo.cs
- PtsHost.cs
- CompiledELinqQueryState.cs
- TrackingWorkflowEventArgs.cs
- ListBox.cs
- GlyphInfoList.cs
- UseAttributeSetsAction.cs
- _OverlappedAsyncResult.cs
- CollectionChangedEventManager.cs
- Options.cs
- WsatConfiguration.cs
- DeploymentSectionCache.cs
- SoapExtensionReflector.cs
- StyleCollectionEditor.cs
- BamlResourceDeserializer.cs
- SystemMulticastIPAddressInformation.cs
- PropertyPath.cs
- DataGridItem.cs
- SerializableReadOnlyDictionary.cs
- HyperLinkStyle.cs
- PersonalizablePropertyEntry.cs
- Line.cs
- CustomAttribute.cs
- DataSourceControlBuilder.cs
- ToolTip.cs
- HttpClientCertificate.cs
- CustomAttributeSerializer.cs
- EmptyControlCollection.cs
- DropDownButton.cs