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
- WebPart.cs
- ParentQuery.cs
- NavigationPropertyEmitter.cs
- ResourcePart.cs
- WaitingCursor.cs
- ContextBase.cs
- SponsorHelper.cs
- BrushValueSerializer.cs
- TaskFileService.cs
- EmptyReadOnlyDictionaryInternal.cs
- ControlBuilderAttribute.cs
- QuaternionConverter.cs
- BuildResultCache.cs
- SqlTrackingWorkflowInstance.cs
- XmlDataProvider.cs
- QuaternionRotation3D.cs
- ObjectAnimationUsingKeyFrames.cs
- HealthMonitoringSectionHelper.cs
- TimelineGroup.cs
- GroupQuery.cs
- SafeViewOfFileHandle.cs
- SystemDiagnosticsSection.cs
- BasicExpandProvider.cs
- MailAddressCollection.cs
- XmlSerializerSection.cs
- documentsequencetextview.cs
- AsyncOperationManager.cs
- RegexStringValidator.cs
- Hash.cs
- InternalConfigEventArgs.cs
- HostUtils.cs
- RecipientInfo.cs
- HelpInfo.cs
- EditingMode.cs
- ValidationErrorCollection.cs
- SelectQueryOperator.cs
- CodeGenerator.cs
- DeflateStreamAsyncResult.cs
- ListViewItem.cs
- _IPv6Address.cs
- DirectionalLight.cs
- SQlBooleanStorage.cs
- ReceiveSecurityHeaderElementManager.cs
- XmlSchemaObjectTable.cs
- TypeForwardedToAttribute.cs
- EventSetter.cs
- SiteIdentityPermission.cs
- WmlTextViewAdapter.cs
- XmlException.cs
- MetafileHeaderEmf.cs
- TypefaceCollection.cs
- GenericIdentity.cs
- RegularExpressionValidator.cs
- ResourcePool.cs
- AuthenticationService.cs
- MyContact.cs
- MemberMaps.cs
- Inline.cs
- XPathSingletonIterator.cs
- PasswordBox.cs
- SerialErrors.cs
- BaseProcessProtocolHandler.cs
- WebRequestModulesSection.cs
- EntityDataSourceDesignerHelper.cs
- CqlErrorHelper.cs
- RequiredFieldValidator.cs
- AsymmetricSignatureFormatter.cs
- ConvertBinder.cs
- ObjectDataSourceStatusEventArgs.cs
- ProcessManager.cs
- HwndSource.cs
- EventProxy.cs
- PermissionSetTriple.cs
- TemplateKeyConverter.cs
- MaskedTextBox.cs
- TransactionScope.cs
- TextRangeEditTables.cs
- ReachPrintTicketSerializerAsync.cs
- SafeThreadHandle.cs
- BinHexDecoder.cs
- DialogResultConverter.cs
- _Semaphore.cs
- KnownBoxes.cs
- FontNamesConverter.cs
- log.cs
- StaticFileHandler.cs
- SafeNativeMethods.cs
- PreservationFileReader.cs
- DesignerInterfaces.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- MultiplexingDispatchMessageFormatter.cs
- ScriptHandlerFactory.cs
- BaseTemplateBuildProvider.cs
- CatalogPartCollection.cs
- FloaterBaseParagraph.cs
- ConfigurationPropertyCollection.cs
- SystemIcmpV4Statistics.cs
- ArgumentException.cs
- XmlDomTextWriter.cs
- ScopelessEnumAttribute.cs