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
- Timer.cs
- ServerReliableChannelBinder.cs
- RootProfilePropertySettingsCollection.cs
- Int32Converter.cs
- Assembly.cs
- TreeBuilderXamlTranslator.cs
- WorkflowTransactionService.cs
- DBConcurrencyException.cs
- RectAnimation.cs
- MultipartContentParser.cs
- ConsoleTraceListener.cs
- XPathAncestorIterator.cs
- FullTextLine.cs
- TextDpi.cs
- ClientSettingsSection.cs
- TextDpi.cs
- TagPrefixCollection.cs
- SpellerInterop.cs
- OLEDB_Util.cs
- FormViewUpdatedEventArgs.cs
- ObjectSecurity.cs
- AggregateException.cs
- PrivilegeNotHeldException.cs
- TrackingProfile.cs
- MailDefinition.cs
- VideoDrawing.cs
- DetailsViewAutoFormat.cs
- EndpointAddressAugust2004.cs
- ListBoxItem.cs
- basemetadatamappingvisitor.cs
- NavigatorOutput.cs
- ObjectReferenceStack.cs
- CodeNamespace.cs
- EntityDataSourceValidationException.cs
- PrimitiveXmlSerializers.cs
- HttpCacheVary.cs
- XmlNavigatorFilter.cs
- StoreAnnotationsMap.cs
- ApplicationTrust.cs
- TransactionTraceIdentifier.cs
- DataControlFieldsEditor.cs
- XmlJsonWriter.cs
- FontWeightConverter.cs
- COMException.cs
- ExponentialEase.cs
- RequestTimeoutManager.cs
- PlatformCulture.cs
- TreeView.cs
- FirewallWrapper.cs
- CharacterBufferReference.cs
- ContractReference.cs
- CustomTypeDescriptor.cs
- SimpleBitVector32.cs
- KeyEventArgs.cs
- GridItemCollection.cs
- DataGridViewRowCancelEventArgs.cs
- ProxyGenerator.cs
- IdnMapping.cs
- GuidConverter.cs
- RouteCollection.cs
- DesignerSerializationOptionsAttribute.cs
- SecurityProtocolCorrelationState.cs
- ObjectSecurity.cs
- XPathAncestorIterator.cs
- CryptoConfig.cs
- ThreadAbortException.cs
- QueryServiceConfigHandle.cs
- VirtualPathProvider.cs
- MethodCallConverter.cs
- Char.cs
- RewritingValidator.cs
- LabelDesigner.cs
- UIElement3D.cs
- DataFieldEditor.cs
- ToolStripContextMenu.cs
- ObjectIDGenerator.cs
- ViewStateModeByIdAttribute.cs
- SafeRegistryHandle.cs
- GroupByExpressionRewriter.cs
- MailMessage.cs
- CoTaskMemUnicodeSafeHandle.cs
- EnumValidator.cs
- Models.cs
- Positioning.cs
- HtmlEncodedRawTextWriter.cs
- PasswordTextNavigator.cs
- ExitEventArgs.cs
- BulletDecorator.cs
- DirtyTextRange.cs
- DataQuery.cs
- NavigationHelper.cs
- FileDialog_Vista.cs
- Socket.cs
- XhtmlConformanceSection.cs
- OdbcError.cs
- DebuggerAttributes.cs
- Operand.cs
- FieldMetadata.cs
- WindowsPrincipal.cs
- ChtmlTextBoxAdapter.cs