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
- PanelStyle.cs
- BindingsCollection.cs
- DbFunctionCommandTree.cs
- _NegoState.cs
- MinimizableAttributeTypeConverter.cs
- ReplyChannel.cs
- XhtmlBasicCommandAdapter.cs
- BigInt.cs
- TextBoxAutoCompleteSourceConverter.cs
- ToolTipAutomationPeer.cs
- TransformerInfo.cs
- LicenseContext.cs
- SpecularMaterial.cs
- Timer.cs
- HttpServerVarsCollection.cs
- xmlglyphRunInfo.cs
- ADConnectionHelper.cs
- FixedLineResult.cs
- Win32NamedPipes.cs
- Header.cs
- ipaddressinformationcollection.cs
- DataControlPagerLinkButton.cs
- SwitchLevelAttribute.cs
- JoinCqlBlock.cs
- _BufferOffsetSize.cs
- Int16KeyFrameCollection.cs
- DiagnosticsConfigurationHandler.cs
- LostFocusEventManager.cs
- NullableConverter.cs
- XmlKeywords.cs
- NamespaceListProperty.cs
- IsolatedStorageFilePermission.cs
- HtmlButton.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Point3DIndependentAnimationStorage.cs
- SmiMetaDataProperty.cs
- TextEditorCopyPaste.cs
- ResourceContainer.cs
- NativeMethods.cs
- EventLogInformation.cs
- DataSourceXmlAttributeAttribute.cs
- PackagingUtilities.cs
- __ComObject.cs
- ConstraintEnumerator.cs
- AccessibleObject.cs
- _RequestCacheProtocol.cs
- ObjectDisposedException.cs
- TextBox.cs
- MessageBodyMemberAttribute.cs
- CachedPathData.cs
- ActivityBindForm.cs
- ProfessionalColors.cs
- SqlConnectionString.cs
- GACMembershipCondition.cs
- FocusChangedEventArgs.cs
- RoutedCommand.cs
- LoginUtil.cs
- TableRow.cs
- FileUtil.cs
- XmlSchemaException.cs
- InstanceKeyView.cs
- Vector3DConverter.cs
- UnmanagedMemoryStream.cs
- ExtensionCollection.cs
- PlanCompilerUtil.cs
- OutputBuffer.cs
- CngKeyCreationParameters.cs
- OdbcError.cs
- SystemThemeKey.cs
- Manipulation.cs
- Number.cs
- RefType.cs
- DetailsViewRow.cs
- GestureRecognitionResult.cs
- arabicshape.cs
- CompilationSection.cs
- DoubleAnimation.cs
- FileSystemInfo.cs
- Rect3D.cs
- XmlArrayItemAttributes.cs
- VoiceObjectToken.cs
- SocketCache.cs
- StylusPointPropertyInfoDefaults.cs
- NamespaceCollection.cs
- Point3DCollectionConverter.cs
- XPathDocumentNavigator.cs
- XslAstAnalyzer.cs
- FontNamesConverter.cs
- OnOperation.cs
- Int32Converter.cs
- CompilationLock.cs
- RequestNavigateEventArgs.cs
- EntityDataSourceQueryBuilder.cs
- ProfileService.cs
- AuthorizationRule.cs
- SpeechDetectedEventArgs.cs
- AccessDataSource.cs
- ExceptionValidationRule.cs
- WindowsSysHeader.cs
- ToolStripContentPanel.cs