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
- DataListItem.cs
- SettingsPropertyCollection.cs
- WmlValidatorAdapter.cs
- ColumnResizeUndoUnit.cs
- SizeAnimation.cs
- GPPOINT.cs
- ElapsedEventArgs.cs
- ListViewSortEventArgs.cs
- LassoHelper.cs
- StrongTypingException.cs
- hwndwrapper.cs
- EdmError.cs
- CacheVirtualItemsEvent.cs
- ExternalCalls.cs
- SqlConnectionPoolProviderInfo.cs
- AttributeInfo.cs
- HttpCacheVary.cs
- XmlILConstructAnalyzer.cs
- StateRuntime.cs
- columnmapfactory.cs
- AuditLog.cs
- NeedSkipTokenVisitor.cs
- Parameter.cs
- SemanticAnalyzer.cs
- RemotingConfiguration.cs
- ToolStripDropTargetManager.cs
- ToolStripTextBox.cs
- XmlQuerySequence.cs
- CultureInfoConverter.cs
- IsolationInterop.cs
- TextServicesManager.cs
- SyntaxCheck.cs
- CodeComment.cs
- InputProcessorProfilesLoader.cs
- WriteTimeStream.cs
- DataGridViewComponentPropertyGridSite.cs
- AuthenticationConfig.cs
- WindowsIPAddress.cs
- AppSettingsReader.cs
- RoutedEventValueSerializer.cs
- WebPartUserCapability.cs
- WebHeaderCollection.cs
- CommunicationObjectAbortedException.cs
- BitmapPalette.cs
- BitVector32.cs
- UserValidatedEventArgs.cs
- ResponseBodyWriter.cs
- EventDrivenDesigner.cs
- X509ImageLogo.cs
- RegexCompilationInfo.cs
- TaskFileService.cs
- ExpandoObject.cs
- TableRow.cs
- SqlConnection.cs
- BindingRestrictions.cs
- TableRowCollection.cs
- Point4DValueSerializer.cs
- ThemeInfoAttribute.cs
- PanelStyle.cs
- DataServiceEntityAttribute.cs
- MetadataArtifactLoaderComposite.cs
- Number.cs
- ArraySet.cs
- EventsTab.cs
- PixelFormatConverter.cs
- XmlSchemaSimpleTypeList.cs
- TranslateTransform3D.cs
- IncrementalHitTester.cs
- DbDeleteCommandTree.cs
- EditingCoordinator.cs
- Zone.cs
- CodeCompileUnit.cs
- Throw.cs
- QuaternionAnimationBase.cs
- HMACSHA384.cs
- PropertyInformation.cs
- DataTablePropertyDescriptor.cs
- DeviceContext.cs
- HttpDigestClientElement.cs
- BoolExpr.cs
- HyperlinkAutomationPeer.cs
- __ConsoleStream.cs
- ToolStripDropDown.cs
- ClientTarget.cs
- RequestQueryProcessor.cs
- RewritingSimplifier.cs
- InputProcessorProfilesLoader.cs
- RegexNode.cs
- CommandEventArgs.cs
- DataTableReader.cs
- RSAOAEPKeyExchangeFormatter.cs
- DataGridViewDesigner.cs
- CommandLineParser.cs
- GridView.cs
- ExpressionPrefixAttribute.cs
- TreeNodeClickEventArgs.cs
- ToolStripPanelSelectionBehavior.cs
- sqlmetadatafactory.cs
- WebPartVerbCollection.cs
- MemberProjectedSlot.cs