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
- PageSettings.cs
- ListDictionaryInternal.cs
- CodeMemberEvent.cs
- DataGridViewTopRowAccessibleObject.cs
- MemberDescriptor.cs
- TreeViewEvent.cs
- WebHttpElement.cs
- ItemType.cs
- Tuple.cs
- ServiceRoute.cs
- MenuStrip.cs
- ItemContainerGenerator.cs
- AsyncResult.cs
- VBCodeProvider.cs
- ByeMessageApril2005.cs
- PerformanceCounterPermissionEntryCollection.cs
- SQLUtility.cs
- InternalTypeHelper.cs
- FixUpCollection.cs
- Parameter.cs
- ScrollChrome.cs
- PrintDialogDesigner.cs
- AssociationEndMember.cs
- DataTableCollection.cs
- HtmlHistory.cs
- Run.cs
- TextFormatterHost.cs
- WindowsSolidBrush.cs
- HttpApplication.cs
- ReferenceTypeElement.cs
- XmlTextReader.cs
- Brush.cs
- SafeNativeMethods.cs
- XmlNodeComparer.cs
- SQLStringStorage.cs
- CqlLexerHelpers.cs
- CodeObjectCreateExpression.cs
- OleDbCommand.cs
- TransformCollection.cs
- ProgressiveCrcCalculatingStream.cs
- SecurityTokenProviderContainer.cs
- TextBox.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Wizard.cs
- OrderedDictionaryStateHelper.cs
- EditingScope.cs
- SqlLiftWhereClauses.cs
- XmlSchemaDocumentation.cs
- WebReferencesBuildProvider.cs
- EntityDataSourceContainerNameItem.cs
- SupportedAddressingMode.cs
- DataObjectCopyingEventArgs.cs
- Permission.cs
- RepeaterItem.cs
- ListViewItemEventArgs.cs
- ObjectStateManager.cs
- Oci.cs
- SignatureSummaryDialog.cs
- FileClassifier.cs
- SqlUtils.cs
- AQNBuilder.cs
- tooltip.cs
- XmlDocumentSerializer.cs
- _FtpDataStream.cs
- QilLoop.cs
- PageFunction.cs
- XmlSchemaSubstitutionGroup.cs
- SeekableMessageNavigator.cs
- AutomationEvent.cs
- CatalogPartCollection.cs
- SmtpNtlmAuthenticationModule.cs
- MenuItemStyleCollection.cs
- Constants.cs
- PartialCachingControl.cs
- Screen.cs
- UserControl.cs
- ForeignKeyConstraint.cs
- TypeDefinition.cs
- Roles.cs
- Encoding.cs
- UrlAuthFailedErrorFormatter.cs
- InheritanceService.cs
- SqlUtils.cs
- AppSettingsReader.cs
- ExeContext.cs
- DataGridColumnsPage.cs
- CodeChecksumPragma.cs
- XpsFilter.cs
- KeyGesture.cs
- XmlChildEnumerator.cs
- EraserBehavior.cs
- KnownBoxes.cs
- SystemTcpStatistics.cs
- AppLevelCompilationSectionCache.cs
- IntranetCredentialPolicy.cs
- RoutedEventArgs.cs
- FontFamilyConverter.cs
- MenuItemCollectionEditor.cs
- ResizeGrip.cs
- SmiContextFactory.cs