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
- TreeNodeStyleCollection.cs
- WsdlInspector.cs
- SafeMILHandle.cs
- Configuration.cs
- Compiler.cs
- GroupBoxRenderer.cs
- ClientTargetSection.cs
- VarRemapper.cs
- InvokeGenerator.cs
- GotoExpression.cs
- CharConverter.cs
- SafeRegistryHandle.cs
- UnsafeNativeMethods.cs
- CustomCategoryAttribute.cs
- ToolTipAutomationPeer.cs
- PassportAuthenticationEventArgs.cs
- EarlyBoundInfo.cs
- PopupControlService.cs
- XmlAtomicValue.cs
- GeneralTransform2DTo3DTo2D.cs
- XmlTextReaderImplHelpers.cs
- AnnotationAuthorChangedEventArgs.cs
- StringCollection.cs
- StackOverflowException.cs
- DashStyles.cs
- _IPv4Address.cs
- SerializationObjectManager.cs
- PassportAuthentication.cs
- TextCharacters.cs
- DrawToolTipEventArgs.cs
- NonNullItemCollection.cs
- XmlFormatExtensionAttribute.cs
- NotImplementedException.cs
- DataBinder.cs
- ObjectQuery_EntitySqlExtensions.cs
- SqlUtil.cs
- CompositionTarget.cs
- CommandField.cs
- _ProxyRegBlob.cs
- BinaryFormatter.cs
- TemplateEditingFrame.cs
- XNameTypeConverter.cs
- DataGridState.cs
- RadioButton.cs
- UrlMappingCollection.cs
- Regex.cs
- GridViewAutomationPeer.cs
- X509AsymmetricSecurityKey.cs
- Parallel.cs
- TemplatedWizardStep.cs
- LinqDataSourceUpdateEventArgs.cs
- TCPListener.cs
- odbcmetadatacollectionnames.cs
- EventLogTraceListener.cs
- SrgsGrammarCompiler.cs
- VisualBrush.cs
- ProxyManager.cs
- PerformanceCountersElement.cs
- ByteStream.cs
- Group.cs
- TickBar.cs
- DrawingContextDrawingContextWalker.cs
- DataSetUtil.cs
- XmlSerializerAssemblyAttribute.cs
- WindowsAuthenticationEventArgs.cs
- RoleManagerModule.cs
- TableRow.cs
- ModelTypeConverter.cs
- UpDownEvent.cs
- ZipIOModeEnforcingStream.cs
- EventOpcode.cs
- SymbolMethod.cs
- GAC.cs
- FormatterServices.cs
- DockPatternIdentifiers.cs
- InstalledFontCollection.cs
- ContractMapping.cs
- EmptyImpersonationContext.cs
- CqlBlock.cs
- RIPEMD160Managed.cs
- WindowCollection.cs
- NonSerializedAttribute.cs
- ObjRef.cs
- Icon.cs
- ImagingCache.cs
- PageOutputColor.cs
- UnaryNode.cs
- MdiWindowListItemConverter.cs
- MailWebEventProvider.cs
- CTreeGenerator.cs
- MetadataCache.cs
- URL.cs
- XmlFormatMapping.cs
- ObjectListCommandEventArgs.cs
- EditingMode.cs
- Color.cs
- EventWaitHandleSecurity.cs
- GrabHandleGlyph.cs
- XmlDocumentFragment.cs
- TypedTableHandler.cs