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
- PointUtil.cs
- CharKeyFrameCollection.cs
- SchemaNotation.cs
- ChannelBinding.cs
- _FtpDataStream.cs
- EntityKeyElement.cs
- FormViewDeleteEventArgs.cs
- HttpMethodConstraint.cs
- WindowsButton.cs
- sapiproxy.cs
- FileSystemWatcher.cs
- EntityType.cs
- SQLMoneyStorage.cs
- SafeFindHandle.cs
- TextElementAutomationPeer.cs
- TableLayoutPanel.cs
- RightsManagementErrorHandler.cs
- ArrayList.cs
- uribuilder.cs
- WebPartDisplayModeCollection.cs
- AssemblyAttributesGoHere.cs
- MaskInputRejectedEventArgs.cs
- AllMembershipCondition.cs
- XmlBinaryWriter.cs
- ObjectReaderCompiler.cs
- MemberCollection.cs
- SmiXetterAccessMap.cs
- ParameterBinding.cs
- DataGridTableCollection.cs
- MimeParameter.cs
- MarkedHighlightComponent.cs
- AutoGeneratedFieldProperties.cs
- SizeLimitedCache.cs
- InputProviderSite.cs
- AsyncCompletedEventArgs.cs
- String.cs
- Hash.cs
- Number.cs
- XmlArrayItemAttributes.cs
- ServiceDeploymentInfo.cs
- XmlCharacterData.cs
- DefaultHttpHandler.cs
- PenThread.cs
- ParserOptions.cs
- ObjectNavigationPropertyMapping.cs
- XmlSignificantWhitespace.cs
- TextFormatterImp.cs
- DNS.cs
- DSASignatureDeformatter.cs
- WebPageTraceListener.cs
- WizardStepBase.cs
- HostDesigntimeLicenseContext.cs
- CommandManager.cs
- EnumerableValidator.cs
- LocalServiceSecuritySettings.cs
- Positioning.cs
- odbcmetadatacolumnnames.cs
- GrammarBuilderRuleRef.cs
- XmlWriterDelegator.cs
- SQLByteStorage.cs
- DecimalFormatter.cs
- MetaModel.cs
- XsltInput.cs
- ICspAsymmetricAlgorithm.cs
- XmlRawWriterWrapper.cs
- ResourcePermissionBaseEntry.cs
- CacheEntry.cs
- HostedElements.cs
- ControlAdapter.cs
- DefaultObjectMappingItemCollection.cs
- SmtpException.cs
- BinaryParser.cs
- FormsAuthentication.cs
- TargetConverter.cs
- TextEncodedRawTextWriter.cs
- ReliableSessionElement.cs
- CodeMemberMethod.cs
- Encoder.cs
- ExpandCollapseProviderWrapper.cs
- DetailsViewPagerRow.cs
- DataSourceXmlAttributeAttribute.cs
- IDispatchConstantAttribute.cs
- PolygonHotSpot.cs
- Pair.cs
- MediaPlayerState.cs
- TimeSpanConverter.cs
- _CacheStreams.cs
- EventLogEntry.cs
- SqlNamer.cs
- coordinator.cs
- FilteredDataSetHelper.cs
- BasicHttpSecurity.cs
- XAMLParseException.cs
- RightsManagementPermission.cs
- ToolStripDropDownMenu.cs
- SqlInfoMessageEvent.cs
- XmlCharacterData.cs
- Triplet.cs
- TextServicesDisplayAttributePropertyRanges.cs
- HtmlLiteralTextAdapter.cs