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
- XamlFrame.cs
- TextEditor.cs
- UshortList2.cs
- XmlQualifiedNameTest.cs
- DataGridViewBindingCompleteEventArgs.cs
- OleDbDataReader.cs
- RuntimeConfigLKG.cs
- BasePropertyDescriptor.cs
- FusionWrap.cs
- XmlSchemaProviderAttribute.cs
- X509CertificateChain.cs
- EdmPropertyAttribute.cs
- DateTimeConverter2.cs
- MatrixTransform.cs
- ManagementInstaller.cs
- ScaleTransform3D.cs
- DataServiceRequestException.cs
- EventLogPermissionEntryCollection.cs
- CharAnimationUsingKeyFrames.cs
- TextCollapsingProperties.cs
- PointF.cs
- DeploymentExceptionMapper.cs
- TypedTableGenerator.cs
- TableParagraph.cs
- DrawingContextWalker.cs
- XmlSchemaObjectCollection.cs
- Vector3DAnimationBase.cs
- ValueCollectionParameterReader.cs
- TcpProcessProtocolHandler.cs
- RegisteredDisposeScript.cs
- ExpressionSelection.cs
- SafeLibraryHandle.cs
- GifBitmapEncoder.cs
- GridViewDeleteEventArgs.cs
- AccessDataSourceWizardForm.cs
- WebPartConnectionsCancelEventArgs.cs
- ZoneButton.cs
- BCryptNative.cs
- keycontainerpermission.cs
- SupportsEventValidationAttribute.cs
- ReflectionUtil.cs
- TextFormatterImp.cs
- JournalNavigationScope.cs
- SqlDataReader.cs
- UnsafeNativeMethodsPenimc.cs
- ThreadAttributes.cs
- BindingOperations.cs
- PeerTransportSecuritySettings.cs
- HasActivatableWorkflowEvent.cs
- RichTextBox.cs
- PageRequestManager.cs
- EarlyBoundInfo.cs
- codemethodreferenceexpression.cs
- FormsAuthenticationUserCollection.cs
- MetafileHeader.cs
- SqlLiftIndependentRowExpressions.cs
- XmlQueryCardinality.cs
- ColumnHeaderConverter.cs
- SourceFilter.cs
- OdbcRowUpdatingEvent.cs
- MimeObjectFactory.cs
- ChameleonKey.cs
- TextSelectionHelper.cs
- InfoCardSymmetricAlgorithm.cs
- EntityFrameworkVersions.cs
- TypeRestriction.cs
- BorderGapMaskConverter.cs
- SelectiveScrollingGrid.cs
- RandomNumberGenerator.cs
- Debugger.cs
- MessagePartDescriptionCollection.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- XNodeSchemaApplier.cs
- XsltConvert.cs
- MenuTracker.cs
- SmiGettersStream.cs
- FileDialogCustomPlace.cs
- ObjectViewListener.cs
- LinqDataSourceView.cs
- CodeDefaultValueExpression.cs
- GenericIdentity.cs
- Tile.cs
- ObjectMemberMapping.cs
- XmlSchemaObjectCollection.cs
- RequestedSignatureDialog.cs
- CompositeCollectionView.cs
- ApplicationSecurityManager.cs
- X509Chain.cs
- Operators.cs
- TreeNodeConverter.cs
- ComboBox.cs
- TranslateTransform3D.cs
- SystemIdentity.cs
- SqlRetyper.cs
- ObjectTag.cs
- GroupLabel.cs
- BufferModesCollection.cs
- XmlChoiceIdentifierAttribute.cs
- XamlPoint3DCollectionSerializer.cs
- CodeNamespaceImportCollection.cs