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
- CustomExpressionEventArgs.cs
- SamlEvidence.cs
- SiblingIterators.cs
- PageBuildProvider.cs
- XmlBoundElement.cs
- LogSwitch.cs
- FunctionGenerator.cs
- TypeToStringValueConverter.cs
- PrimarySelectionGlyph.cs
- CompareValidator.cs
- SizeAnimationBase.cs
- basecomparevalidator.cs
- ViewCellSlot.cs
- Matrix.cs
- odbcmetadatafactory.cs
- HttpResponseHeader.cs
- ToolStripButton.cs
- WindowsSysHeader.cs
- RegexGroupCollection.cs
- DictionaryEntry.cs
- TextEditorLists.cs
- SqlBulkCopyColumnMapping.cs
- EventsTab.cs
- MultiSelector.cs
- ImagingCache.cs
- DataServiceHost.cs
- DataChangedEventManager.cs
- SolidColorBrush.cs
- TableHeaderCell.cs
- EditorAttribute.cs
- TextParaLineResult.cs
- HostingEnvironmentSection.cs
- TableItemStyle.cs
- TemplateEditingFrame.cs
- GeneralTransform3DTo2DTo3D.cs
- ModelEditingScope.cs
- AuthorizationSection.cs
- TreeNodeMouseHoverEvent.cs
- ExpandCollapsePattern.cs
- EditingCommands.cs
- LocatorPart.cs
- AssemblyBuilderData.cs
- RequestQueryParser.cs
- Latin1Encoding.cs
- TextDecorationCollection.cs
- WindowShowOrOpenTracker.cs
- Quaternion.cs
- Geometry.cs
- ConditionalAttribute.cs
- BindingExpressionUncommonField.cs
- InkCanvasFeedbackAdorner.cs
- OracleBinary.cs
- DropDownButton.cs
- RightsManagementInformation.cs
- SubclassTypeValidator.cs
- XpsFilter.cs
- SystemPens.cs
- TextBox.cs
- AdCreatedEventArgs.cs
- Root.cs
- PartitionResolver.cs
- COM2ExtendedTypeConverter.cs
- Cursor.cs
- LZCodec.cs
- SpellCheck.cs
- BrowserDefinition.cs
- TabletDevice.cs
- RIPEMD160Managed.cs
- RotateTransform.cs
- XmlStreamStore.cs
- Win32Native.cs
- altserialization.cs
- ImageMapEventArgs.cs
- EnumMemberAttribute.cs
- ActivityDesignerAccessibleObject.cs
- XmlLoader.cs
- ChangeBlockUndoRecord.cs
- MDIWindowDialog.cs
- LinqMaximalSubtreeNominator.cs
- MessageSecurityOverHttpElement.cs
- NotSupportedException.cs
- SingleAnimation.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ScriptComponentDescriptor.cs
- NamespaceListProperty.cs
- OdbcParameterCollection.cs
- XPathAxisIterator.cs
- TypeUtil.cs
- WebEncodingValidatorAttribute.cs
- Rect.cs
- MetabaseServerConfig.cs
- WebException.cs
- RegexRunner.cs
- NotifyCollectionChangedEventArgs.cs
- SafeFileMappingHandle.cs
- Rule.cs
- CodeValidator.cs
- AssemblyNameProxy.cs
- UrlPath.cs
- XmlValidatingReaderImpl.cs