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
- BindingWorker.cs
- Version.cs
- _NegoStream.cs
- TextRangeSerialization.cs
- SingleConverter.cs
- ConstructorBuilder.cs
- FacetEnabledSchemaElement.cs
- XPathPatternParser.cs
- Int64Converter.cs
- ControlDesignerState.cs
- CodeIdentifier.cs
- RequiredFieldValidator.cs
- PageAdapter.cs
- OutputCacheProviderCollection.cs
- CheckableControlBaseAdapter.cs
- _LocalDataStoreMgr.cs
- FileLevelControlBuilderAttribute.cs
- BevelBitmapEffect.cs
- SafeLocalMemHandle.cs
- DefaultMemberAttribute.cs
- Quaternion.cs
- DataTableReaderListener.cs
- TextCompositionEventArgs.cs
- XmlReflectionImporter.cs
- WebRequestModulesSection.cs
- JsonUriDataContract.cs
- validationstate.cs
- NavigateEvent.cs
- DataGridClipboardHelper.cs
- SiteMapPathDesigner.cs
- CompilerResults.cs
- BookmarkUndoUnit.cs
- WebPartsPersonalization.cs
- Transform.cs
- DesignerEditorPartChrome.cs
- CacheSection.cs
- ChildTable.cs
- XmlAttributeAttribute.cs
- DBSchemaRow.cs
- ConnectionProviderAttribute.cs
- CategoryEditor.cs
- ScriptIgnoreAttribute.cs
- ComplexTypeEmitter.cs
- DriveNotFoundException.cs
- __FastResourceComparer.cs
- DoubleIndependentAnimationStorage.cs
- HostingEnvironmentException.cs
- UpDownEvent.cs
- ConfigurationErrorsException.cs
- InputLanguage.cs
- DirectoryRedirect.cs
- PolicyManager.cs
- DataGridCaption.cs
- Win32SafeHandles.cs
- SamlAudienceRestrictionCondition.cs
- ListViewTableCell.cs
- MSAANativeProvider.cs
- BitmapVisualManager.cs
- DataColumnMapping.cs
- ListenerAdapter.cs
- PersistencePipeline.cs
- UserControlCodeDomTreeGenerator.cs
- ComponentSerializationService.cs
- RawUIStateInputReport.cs
- PropertyReference.cs
- DES.cs
- TextClipboardData.cs
- Rotation3DKeyFrameCollection.cs
- SplitterEvent.cs
- RotateTransform.cs
- SchemaElementLookUpTable.cs
- SerializerWriterEventHandlers.cs
- AssertSection.cs
- CapabilitiesPattern.cs
- ImplicitInputBrush.cs
- Int32AnimationUsingKeyFrames.cs
- ListViewInsertEventArgs.cs
- OracleFactory.cs
- StylusEditingBehavior.cs
- Soap.cs
- CheckBoxPopupAdapter.cs
- VisualBasicExpressionConverter.cs
- RootBrowserWindow.cs
- InvalidFilterCriteriaException.cs
- AuthenticationSection.cs
- InfoCardUIAgent.cs
- HyperLinkColumn.cs
- DateTime.cs
- SecurityDocument.cs
- VisualTreeUtils.cs
- ProtocolsConfiguration.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SynchronizationFilter.cs
- TextElement.cs
- HtmlDocument.cs
- _NetworkingPerfCounters.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- BaseTypeViewSchema.cs
- SpellerHighlightLayer.cs
- AppDomainShutdownMonitor.cs