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
- ApplicationId.cs
- PipelineModuleStepContainer.cs
- AdapterDictionary.cs
- TemplateBindingExpressionConverter.cs
- TextEndOfLine.cs
- Model3D.cs
- XmlEventCache.cs
- TagPrefixAttribute.cs
- GenericRootAutomationPeer.cs
- ValueType.cs
- URLMembershipCondition.cs
- HttpContextWrapper.cs
- RuntimeCompatibilityAttribute.cs
- mda.cs
- TargetInvocationException.cs
- SecurityKeyType.cs
- RegexCapture.cs
- MetadataFile.cs
- WindowsRichEdit.cs
- SoapFaultCodes.cs
- PrintPageEvent.cs
- RemoteHelper.cs
- Int32Storage.cs
- SectionRecord.cs
- path.cs
- EntityProviderServices.cs
- CurrentTimeZone.cs
- SEHException.cs
- VisualTreeUtils.cs
- XPathDocumentIterator.cs
- BamlRecordHelper.cs
- ConfigViewGenerator.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- CodeExpressionCollection.cs
- unitconverter.cs
- RemotingSurrogateSelector.cs
- DataGridColumnCollection.cs
- ToolStripArrowRenderEventArgs.cs
- UniqueID.cs
- GridViewSelectEventArgs.cs
- JsonQNameDataContract.cs
- _FtpControlStream.cs
- InstanceDataCollection.cs
- ExportOptions.cs
- TitleStyle.cs
- GridItem.cs
- NominalTypeEliminator.cs
- HostedHttpRequestAsyncResult.cs
- Signature.cs
- TraceHandlerErrorFormatter.cs
- SqlError.cs
- BookmarkNameHelper.cs
- DataSvcMapFileSerializer.cs
- DataGridViewRowsRemovedEventArgs.cs
- DataListItemEventArgs.cs
- Permission.cs
- RegexWorker.cs
- DoubleCollection.cs
- SimpleTypeResolver.cs
- HotCommands.cs
- SoapIncludeAttribute.cs
- ImageButton.cs
- ListViewCancelEventArgs.cs
- RoutedEventArgs.cs
- HandoffBehavior.cs
- ListSourceHelper.cs
- WSDualHttpSecurityElement.cs
- ArgIterator.cs
- Rfc2898DeriveBytes.cs
- PeekCompletedEventArgs.cs
- sapiproxy.cs
- RequestQueryProcessor.cs
- AmbiguousMatchException.cs
- StringExpressionSet.cs
- Configuration.cs
- TreeIterators.cs
- GridViewCommandEventArgs.cs
- Point3D.cs
- HostingEnvironment.cs
- HTTPNotFoundHandler.cs
- ServerValidateEventArgs.cs
- XmlBaseWriter.cs
- DataControlPagerLinkButton.cs
- MarkerProperties.cs
- mediaclock.cs
- ExpressionBuilder.cs
- ConfigurationPermission.cs
- Point3DCollection.cs
- TypeUsageBuilder.cs
- ReachIDocumentPaginatorSerializer.cs
- ServiceDebugBehavior.cs
- AssemblyName.cs
- OleDbEnumerator.cs
- CodeIndexerExpression.cs
- securestring.cs
- _CacheStreams.cs
- ElementAction.cs
- XomlCompilerResults.cs
- RoleServiceManager.cs
- MatrixIndependentAnimationStorage.cs