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
- GetWinFXPath.cs
- StringAnimationBase.cs
- SqlReferenceCollection.cs
- AutomationFocusChangedEventArgs.cs
- NotifyInputEventArgs.cs
- XsltQilFactory.cs
- MatrixUtil.cs
- IDQuery.cs
- ValidationResults.cs
- LayoutEvent.cs
- ModelPropertyImpl.cs
- RootBrowserWindowProxy.cs
- DbConnectionClosed.cs
- ToolStripOverflowButton.cs
- FileSecurity.cs
- ShapingWorkspace.cs
- SqlDataReader.cs
- ThumbButtonInfoCollection.cs
- MimeMultiPart.cs
- SqlNodeAnnotations.cs
- CompilerResults.cs
- DecimalKeyFrameCollection.cs
- StreamResourceInfo.cs
- LogAppendAsyncResult.cs
- XamlToRtfParser.cs
- AttributeProviderAttribute.cs
- ObjectDataSourceMethodEventArgs.cs
- BrushConverter.cs
- OdbcDataReader.cs
- TypedTableBase.cs
- ObjectDataSourceEventArgs.cs
- SafeArrayRankMismatchException.cs
- ISFClipboardData.cs
- HashCodeCombiner.cs
- BaseCodeDomTreeGenerator.cs
- MetadataSource.cs
- EmptyCollection.cs
- CommentEmitter.cs
- TrackingProvider.cs
- TextMarkerSource.cs
- ClientApiGenerator.cs
- DefaultTextStoreTextComposition.cs
- MatrixIndependentAnimationStorage.cs
- SubclassTypeValidator.cs
- InputScope.cs
- EndpointNameMessageFilter.cs
- ZipIORawDataFileBlock.cs
- ResourcePool.cs
- NamespaceMapping.cs
- WinHttpWebProxyFinder.cs
- PerformanceCounterPermissionAttribute.cs
- ByteStack.cs
- PrintDialog.cs
- Cursors.cs
- Keywords.cs
- DataKeyArray.cs
- TreeViewCancelEvent.cs
- InProcStateClientManager.cs
- GetFileNameResult.cs
- SafeMemoryMappedViewHandle.cs
- HandledEventArgs.cs
- TextFragmentEngine.cs
- XmlElementCollection.cs
- ItemMap.cs
- ListViewInsertEventArgs.cs
- WebPartVerb.cs
- WebPartAddingEventArgs.cs
- Control.cs
- FacetChecker.cs
- EasingKeyFrames.cs
- InputReportEventArgs.cs
- ScriptControl.cs
- ManipulationStartingEventArgs.cs
- ToolStripProgressBar.cs
- DefaultAuthorizationContext.cs
- UnsafeNetInfoNativeMethods.cs
- xsdvalidator.cs
- _AuthenticationState.cs
- TagPrefixCollection.cs
- OleDbReferenceCollection.cs
- _NegotiateClient.cs
- RepeaterItem.cs
- PropertyState.cs
- Renderer.cs
- ProtectedUri.cs
- NavigationService.cs
- DataGridViewCellStyleEditor.cs
- SettingsSection.cs
- WCFModelStrings.Designer.cs
- MemoryMappedViewAccessor.cs
- DisplayMemberTemplateSelector.cs
- VariantWrapper.cs
- CqlGenerator.cs
- PropertySet.cs
- AttributeUsageAttribute.cs
- DocumentXPathNavigator.cs
- _NativeSSPI.cs
- HMACSHA1.cs
- PropertyGridView.cs
- StateItem.cs