Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------- // 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
- SplayTreeNode.cs
- FileStream.cs
- DataGridViewMethods.cs
- NotImplementedException.cs
- WorkflowServiceHost.cs
- DataServiceProviderMethods.cs
- CollectionBase.cs
- RegexWorker.cs
- StringConcat.cs
- TextServicesProperty.cs
- RsaSecurityKey.cs
- PagerSettings.cs
- DrawingAttributes.cs
- SHA1.cs
- GeneralTransform3DGroup.cs
- Axis.cs
- TextAutomationPeer.cs
- EntityContainerRelationshipSet.cs
- TreeViewImageKeyConverter.cs
- NavigationEventArgs.cs
- ComponentEditorForm.cs
- ListViewContainer.cs
- PropertyChangingEventArgs.cs
- WriteFileContext.cs
- ObjectStorage.cs
- StaticSiteMapProvider.cs
- SkipQueryOptionExpression.cs
- ObjectFullSpanRewriter.cs
- SimpleMailWebEventProvider.cs
- StrongNameUtility.cs
- DataGridViewRowEventArgs.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XmlName.cs
- EntityUtil.cs
- UnsafeNativeMethods.cs
- X509CertificateCollection.cs
- SudsWriter.cs
- PartitionedStream.cs
- CommandConverter.cs
- NameValueFileSectionHandler.cs
- WebSysDisplayNameAttribute.cs
- BamlLocalizabilityResolver.cs
- Int32EqualityComparer.cs
- ComponentResourceKeyConverter.cs
- IdlingCommunicationPool.cs
- LinkButton.cs
- CompositeActivityMarkupSerializer.cs
- PageWrapper.cs
- XPathSelfQuery.cs
- MachineSettingsSection.cs
- SelectionProviderWrapper.cs
- PseudoWebRequest.cs
- MSG.cs
- GradientStop.cs
- Permission.cs
- BitmapEffectDrawing.cs
- PropertyPathConverter.cs
- OSFeature.cs
- DocumentApplicationJournalEntry.cs
- FilteredReadOnlyMetadataCollection.cs
- ServiceObjectContainer.cs
- MobileSysDescriptionAttribute.cs
- EditorAttribute.cs
- Configuration.cs
- CountdownEvent.cs
- WebBrowserSiteBase.cs
- GacUtil.cs
- SetterBaseCollection.cs
- ElementNotAvailableException.cs
- SendMailErrorEventArgs.cs
- SessionStateItemCollection.cs
- ReadOnlyHierarchicalDataSource.cs
- ClientConfigurationSystem.cs
- ServiceDescriptionData.cs
- WindowsSecurityToken.cs
- HttpWebResponse.cs
- InfocardExtendedInformationEntry.cs
- EntityConnectionStringBuilderItem.cs
- CryptoConfig.cs
- TimeIntervalCollection.cs
- ResourceBinder.cs
- ButtonBase.cs
- RequestCachePolicy.cs
- ClientScriptManager.cs
- ISAPIApplicationHost.cs
- DrawingDrawingContext.cs
- TimeStampChecker.cs
- HwndSourceParameters.cs
- SiteMapPath.cs
- MenuCommands.cs
- WebUtility.cs
- ResourcePool.cs
- Lasso.cs
- SafeNativeMethods.cs
- RectangleHotSpot.cs
- AutomationPeer.cs
- CharEntityEncoderFallback.cs
- SourceChangedEventArgs.cs
- ControlEvent.cs
- EntityDataSourceWrapperPropertyDescriptor.cs