Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Model / DictionaryEditChange.cs / 1305376 / DictionaryEditChange.cs
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.Activities.Presentation.Model
{
using System;
using System.Collections.Generic;
using System.Text;
class DictionaryEditChange : ModelChange
{
public ModelItemDictionary Dictionary { get; set; }
public ModelItem Key { get; set; }
public ModelItem OldValue { get; set; }
public ModelItem NewValue { get; set; }
public ModelTreeManager ModelTreeManager { get; set; }
public override string Description
{
get
{
return SR.DictionaryEditEditingScopeDescription;
}
}
public override bool Apply()
{
ModelItem oldValue = this.Dictionary[this.Key];
if ((oldValue == null && this.NewValue == null) ||
(oldValue != null && this.NewValue != null && oldValue.GetCurrentValue().Equals(this.NewValue.GetCurrentValue())))
{
return false;
}
this.ModelTreeManager.ReAddModelItemToModelTree(this.NewValue);
((ModelItemDictionaryImpl)this.Dictionary).EditCore(this.Key, this.NewValue);
if (null != this.OldValue)
{
this.ModelTreeManager.modelService.OnModelItemRemoved(this.OldValue);
((IModelTreeItem)OldValue).RemoveParent(this.Dictionary);
this.ModelTreeManager.ReleaseModelItem(this.OldValue, this.Dictionary);
}
if (null != this.NewValue)
{
this.ModelTreeManager.modelService.OnModelItemAdded(this.NewValue);
}
return true;
}
public override Change GetInverse()
{
return new DictionaryEditChange()
{
Dictionary = this.Dictionary,
Key = this.Key,
OldValue = this.NewValue,
NewValue = this.OldValue,
ModelTreeManager = this.ModelTreeManager,
};
}
}
}
// 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
- PassportAuthentication.cs
- PropertiesTab.cs
- EventProviderClassic.cs
- FromRequest.cs
- ListViewItem.cs
- MetafileHeader.cs
- Deflater.cs
- ProxyManager.cs
- ExtendedProtectionPolicy.cs
- XmlChildNodes.cs
- OrderByExpression.cs
- ToolStripLabel.cs
- Rect3D.cs
- TextParagraphCache.cs
- TypeGeneratedEventArgs.cs
- ToolbarAUtomationPeer.cs
- PersonalizationStateInfo.cs
- DependencyProperty.cs
- XD.cs
- ConfigurationValue.cs
- ConstructorNeedsTagAttribute.cs
- SqlSupersetValidator.cs
- StringSource.cs
- ImageAutomationPeer.cs
- SplashScreenNativeMethods.cs
- XmlCodeExporter.cs
- ServiceCredentialsSecurityTokenManager.cs
- _NegotiateClient.cs
- FileSystemInfo.cs
- UserPrincipalNameElement.cs
- GridPatternIdentifiers.cs
- Win32Native.cs
- HttpProfileGroupBase.cs
- ComponentGuaranteesAttribute.cs
- DynamicFilter.cs
- XmlProcessingInstruction.cs
- Exceptions.cs
- DiscoveryMessageSequence11.cs
- Knowncolors.cs
- SafeCryptContextHandle.cs
- RuntimeComponentFilter.cs
- XmlSchemaExternal.cs
- DependencyPropertyKey.cs
- FrameworkContentElement.cs
- ConstructorNeedsTagAttribute.cs
- FontFamilyValueSerializer.cs
- CodeSnippetCompileUnit.cs
- InkCanvas.cs
- NGCPageContentSerializerAsync.cs
- XhtmlTextWriter.cs
- AttributeCallbackBuilder.cs
- RelationshipEnd.cs
- SudsParser.cs
- TaskFormBase.cs
- EventLogPermissionEntry.cs
- SQLMoneyStorage.cs
- StylusPointProperties.cs
- DllNotFoundException.cs
- QilNode.cs
- ResolveNameEventArgs.cs
- SecurityToken.cs
- ImportRequest.cs
- PeerNameRecordCollection.cs
- Brushes.cs
- CompensatableSequenceActivity.cs
- ValueExpressions.cs
- cryptoapiTransform.cs
- TableLayoutPanelBehavior.cs
- ParenthesizePropertyNameAttribute.cs
- smtpconnection.cs
- CreateUserWizardStep.cs
- ItemDragEvent.cs
- TypeSystemHelpers.cs
- ResourceProviderFactory.cs
- RequestStatusBarUpdateEventArgs.cs
- Opcode.cs
- SafeHandle.cs
- XmlILStorageConverter.cs
- GridViewRowPresenter.cs
- VisualTreeHelper.cs
- AllMembershipCondition.cs
- AnnotationAdorner.cs
- COM2ExtendedBrowsingHandler.cs
- ClientBuildManagerCallback.cs
- BrowserDefinition.cs
- Timeline.cs
- FontStyles.cs
- ConfigurationSectionCollection.cs
- SiteIdentityPermission.cs
- DataGridViewIntLinkedList.cs
- CodeGen.cs
- RangeValueProviderWrapper.cs
- UidManager.cs
- OdbcCommand.cs
- XDeferredAxisSource.cs
- DateTimeStorage.cs
- Stacktrace.cs
- XmlSignatureManifest.cs
- HttpClientCertificate.cs
- SafeMILHandle.cs