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
- HttpServerVarsCollection.cs
- XamlSerializer.cs
- NamedPipeHostedTransportConfiguration.cs
- MenuEventArgs.cs
- InfocardInteractiveChannelInitializer.cs
- sqlstateclientmanager.cs
- SettingsPropertyWrongTypeException.cs
- PropertyManager.cs
- ContentElement.cs
- WebMessageFormatHelper.cs
- EventListener.cs
- ErrorTableItemStyle.cs
- PenThreadWorker.cs
- ResourcePermissionBase.cs
- ToolStripPanelRenderEventArgs.cs
- OletxVolatileEnlistment.cs
- DataObjectFieldAttribute.cs
- SQLGuidStorage.cs
- TypeConverter.cs
- NumberSubstitution.cs
- ObjectKeyFrameCollection.cs
- SqlMethodCallConverter.cs
- SocketAddress.cs
- Crc32.cs
- DbInsertCommandTree.cs
- EventDescriptorCollection.cs
- GenerateTemporaryTargetAssembly.cs
- SafeCryptoKeyHandle.cs
- ItemsControl.cs
- CodeDelegateCreateExpression.cs
- LinearKeyFrames.cs
- ToolStripOverflowButton.cs
- CodePrimitiveExpression.cs
- TabItemAutomationPeer.cs
- PreviewPrintController.cs
- WSHttpBindingCollectionElement.cs
- ColumnReorderedEventArgs.cs
- DomNameTable.cs
- PropertyMapper.cs
- SecurityTokenParametersEnumerable.cs
- WebPartUserCapability.cs
- ServiceDescriptionSerializer.cs
- DataSourceNameHandler.cs
- FormsAuthenticationConfiguration.cs
- LexicalChunk.cs
- OdbcTransaction.cs
- AvtEvent.cs
- DateTimePicker.cs
- ButtonChrome.cs
- MenuItem.cs
- CodeSubDirectoriesCollection.cs
- PrinterSettings.cs
- BoundField.cs
- BuildResultCache.cs
- PartitionResolver.cs
- TrustSection.cs
- MulticastIPAddressInformationCollection.cs
- SoundPlayerAction.cs
- AccessDataSource.cs
- LinqDataSourceInsertEventArgs.cs
- DataKey.cs
- ToolBarButtonDesigner.cs
- FixedPageAutomationPeer.cs
- ZipIOCentralDirectoryFileHeader.cs
- TopClause.cs
- TagPrefixInfo.cs
- InputBindingCollection.cs
- MethodInfo.cs
- CodeCompiler.cs
- FileReader.cs
- HtmlInputButton.cs
- AssemblySettingAttributes.cs
- X509UI.cs
- HighlightVisual.cs
- ScriptRegistrationManager.cs
- XsdSchemaFileEditor.cs
- Relationship.cs
- HttpConfigurationContext.cs
- DataObject.cs
- _AuthenticationState.cs
- DispatchWrapper.cs
- XsltContext.cs
- UnaryOperationBinder.cs
- HtmlTextArea.cs
- DbParameterCollectionHelper.cs
- QueryCacheEntry.cs
- MetadataProperty.cs
- SystemTcpStatistics.cs
- PackageRelationshipCollection.cs
- DocumentSequenceHighlightLayer.cs
- AssemblyName.cs
- ArraySortHelper.cs
- SHA1.cs
- XmlBinaryWriterSession.cs
- Container.cs
- ImageCollectionEditor.cs
- CellCreator.cs
- LambdaCompiler.Generated.cs
- MarkupCompilePass1.cs
- Signature.cs