Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Model / FakeModelItemImpl.cs / 1305376 / FakeModelItemImpl.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Presentation.Model { ////// FakeModelItemImpl - purpose of this class is to allow full model editing expirience, without need to participate within model tree operations /// If you use this class, even though it contains reference to ModelTreeManager, you are not affecting actual model tree. Any changes made to the /// model, do not result in any undo/redo operations /// see aslo DesignObjectWrapper class for more usage details /// sealed class FakeModelItemImpl : ModelItemImpl { public FakeModelItemImpl(ModelTreeManager modelTreeManager, Type itemType, object instance, FakeModelItemImpl parent) : base(modelTreeManager, itemType, instance, parent) { } public override ModelItem Root { get { if (this.Parent == null) { return this; } else { return this.Parent.Root; } } } protected override void OnPropertyChanged(string propertyName) { IModelTreeItem modelTreeItem = (IModelTreeItem)this; ModelItem currentValue; //if property value has changed - remove existing value, so the ModelPropertyImplementation will //force reading the value from the underlying object if (modelTreeItem.ModelPropertyStore.TryGetValue(propertyName, out currentValue)) { IModelTreeItem valueAsTreeItem = (IModelTreeItem)currentValue; //cleanup references valueAsTreeItem.RemoveParent(this); valueAsTreeItem.RemoveSource(this.Properties[propertyName]); //remove from store modelTreeItem.ModelPropertyStore.Remove(propertyName); } base.OnPropertyChanged(propertyName); } } } // 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
- FixedSOMTableRow.cs
- FieldReference.cs
- PropertyItemInternal.cs
- PersistenceProviderDirectory.cs
- ResourceDisplayNameAttribute.cs
- ResourceProperty.cs
- SqlDependencyListener.cs
- Icon.cs
- TemplateControl.cs
- AppSettingsExpressionBuilder.cs
- StorageInfo.cs
- SubclassTypeValidator.cs
- TypefaceCollection.cs
- DataGridViewCellValidatingEventArgs.cs
- HostProtectionException.cs
- ProfilePropertySettingsCollection.cs
- HostedHttpTransportManager.cs
- SizeAnimationClockResource.cs
- PatternMatcher.cs
- InstanceKeyCollisionException.cs
- Misc.cs
- Ref.cs
- RuntimeConfigLKG.cs
- OdbcEnvironment.cs
- Math.cs
- EntityDesignerDataSourceView.cs
- _Win32.cs
- HijriCalendar.cs
- AuthenticationService.cs
- FilePrompt.cs
- ColumnHeader.cs
- SettingsPropertyIsReadOnlyException.cs
- UnknownWrapper.cs
- AddressHeaderCollectionElement.cs
- XsdBuildProvider.cs
- ListBase.cs
- AttributeQuery.cs
- BinaryFormatter.cs
- Merger.cs
- RequestCachePolicy.cs
- RuleSetDialog.Designer.cs
- Opcode.cs
- ServiceOperation.cs
- InfoCardTrace.cs
- SemanticBasicElement.cs
- ApplicationDirectoryMembershipCondition.cs
- CopyOfAction.cs
- ComponentTray.cs
- TreeView.cs
- StringOutput.cs
- XmlElementList.cs
- ThumbAutomationPeer.cs
- FontCacheUtil.cs
- DirectionalLight.cs
- DesignerTransactionCloseEvent.cs
- BinaryMethodMessage.cs
- FormatterConverter.cs
- PointLight.cs
- PageBreakRecord.cs
- ContextMenuStripGroupCollection.cs
- RoleService.cs
- LiteralSubsegment.cs
- EtwTrace.cs
- FontDifferentiator.cs
- BaseTemplateBuildProvider.cs
- GeometryCombineModeValidation.cs
- LinqToSqlWrapper.cs
- ComplexType.cs
- XPathNodeList.cs
- LinkedResourceCollection.cs
- UpdateProgress.cs
- MiniModule.cs
- DBDataPermission.cs
- EndSelectCardRequest.cs
- MatrixKeyFrameCollection.cs
- PreloadedPackages.cs
- TextTreeTextBlock.cs
- XmlSchemas.cs
- ComboBoxAutomationPeer.cs
- ElementAtQueryOperator.cs
- ListControlDesigner.cs
- AutomationIdentifier.cs
- SqlNodeTypeOperators.cs
- invalidudtexception.cs
- MessageSecurityOverTcp.cs
- DocumentCollection.cs
- Monitor.cs
- UndoEngine.cs
- XmlNullResolver.cs
- RectangleF.cs
- CorrelationKey.cs
- DbXmlEnabledProviderManifest.cs
- SecurityPermission.cs
- Rect3D.cs
- NativeWindow.cs
- StrokeFIndices.cs
- EncoderParameter.cs
- RegexGroupCollection.cs
- PrimaryKeyTypeConverter.cs
- DataControlFieldCell.cs