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
- SelectedDatesCollection.cs
- Padding.cs
- CompareValidator.cs
- ExpressionBuilder.cs
- SchemaUtility.cs
- FontEditor.cs
- listitem.cs
- MemoryStream.cs
- PathSegmentCollection.cs
- RequestCacheEntry.cs
- LocatorPart.cs
- NameValueCollection.cs
- StoreAnnotationsMap.cs
- Helpers.cs
- StoreItemCollection.cs
- Logging.cs
- FlowPosition.cs
- EqualityArray.cs
- SearchExpression.cs
- DataGridViewCellPaintingEventArgs.cs
- StackOverflowException.cs
- OleDbErrorCollection.cs
- DecoratedNameAttribute.cs
- XmlUtil.cs
- DescendantBaseQuery.cs
- ToolTip.cs
- OleDbConnection.cs
- ErrorEventArgs.cs
- GatewayDefinition.cs
- _DomainName.cs
- SystemWebSectionGroup.cs
- Converter.cs
- JsonDeserializer.cs
- CustomPeerResolverService.cs
- HttpModuleAction.cs
- DoubleAnimationUsingPath.cs
- SendKeys.cs
- Geometry3D.cs
- WebPartConnectVerb.cs
- PlainXmlSerializer.cs
- Stopwatch.cs
- RawUIStateInputReport.cs
- RectangleGeometry.cs
- TrailingSpaceComparer.cs
- MessageDescriptionCollection.cs
- ArrayExtension.cs
- CheckBoxList.cs
- PositiveTimeSpanValidator.cs
- SQLCharsStorage.cs
- WebPartDeleteVerb.cs
- Positioning.cs
- StateMachineSubscription.cs
- ComponentChangingEvent.cs
- HttpGetClientProtocol.cs
- ChannelServices.cs
- LoginViewDesigner.cs
- DesignerUtils.cs
- MultiView.cs
- XmlReaderDelegator.cs
- Number.cs
- SecurityTokenTypes.cs
- TraceInternal.cs
- SchemaElement.cs
- SelectionItemPatternIdentifiers.cs
- ToolBarButton.cs
- CacheVirtualItemsEvent.cs
- TreeNodeStyleCollectionEditor.cs
- MenuEventArgs.cs
- XmlProcessingInstruction.cs
- XmlSchemaAttributeGroupRef.cs
- FileSystemWatcher.cs
- CssTextWriter.cs
- Events.cs
- BidOverLoads.cs
- SqlDataReader.cs
- Command.cs
- CroppedBitmap.cs
- LinkClickEvent.cs
- CounterSet.cs
- ValidationException.cs
- Listbox.cs
- ComponentEvent.cs
- PersonalizationEntry.cs
- SymbolMethod.cs
- Expression.DebuggerProxy.cs
- PrePrepareMethodAttribute.cs
- MembershipSection.cs
- BuildProvidersCompiler.cs
- SqlCommand.cs
- CustomErrorsSection.cs
- X509Certificate2Collection.cs
- QuerySettings.cs
- StagingAreaInputItem.cs
- BinHexEncoder.cs
- RulePatternOps.cs
- ScriptReference.cs
- Expression.cs
- TypedReference.cs
- AncestorChangedEventArgs.cs
- Registry.cs