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
- DockAndAnchorLayout.cs
- SystemWebCachingSectionGroup.cs
- ExpressionBuilder.cs
- CurrentChangedEventManager.cs
- EntityDataSourceUtil.cs
- DecoderExceptionFallback.cs
- RuleSettingsCollection.cs
- BasicKeyConstraint.cs
- RbTree.cs
- SystemIcons.cs
- QilBinary.cs
- GlyphRun.cs
- ProcessInfo.cs
- ItemCollection.cs
- StateDesignerConnector.cs
- FontResourceCache.cs
- TranslateTransform3D.cs
- ContentPlaceHolderDesigner.cs
- PieceDirectory.cs
- Unit.cs
- SqlRemoveConstantOrderBy.cs
- SqlProfileProvider.cs
- TextParagraphProperties.cs
- SQLResource.cs
- MultiByteCodec.cs
- TreeView.cs
- ShutDownListener.cs
- BlockExpression.cs
- _LocalDataStoreMgr.cs
- DoubleIndependentAnimationStorage.cs
- TabletCollection.cs
- SchemaCollectionPreprocessor.cs
- EnvironmentPermission.cs
- GridViewColumnHeader.cs
- DocumentViewerAutomationPeer.cs
- WebBrowserDocumentCompletedEventHandler.cs
- EntityDataSourceValidationException.cs
- NativeObjectSecurity.cs
- PrefixQName.cs
- CqlParser.cs
- ActivityTypeResolver.xaml.cs
- WebPermission.cs
- ParentUndoUnit.cs
- SignerInfo.cs
- AssemblyInfo.cs
- Point4DValueSerializer.cs
- ToolStripProgressBar.cs
- SQLDateTime.cs
- Rotation3D.cs
- RegistryPermission.cs
- DataGridCellInfo.cs
- ParseElement.cs
- Control.cs
- FrameworkTextComposition.cs
- NonDualMessageSecurityOverHttp.cs
- Module.cs
- HeaderedContentControl.cs
- Common.cs
- DataColumnMappingCollection.cs
- WebPartPersonalization.cs
- TableCellsCollectionEditor.cs
- LinearGradientBrush.cs
- Internal.cs
- UnsafeNativeMethods.cs
- LoadedOrUnloadedOperation.cs
- WindowsSecurityToken.cs
- ConfigXmlDocument.cs
- ManualResetEvent.cs
- fixedPageContentExtractor.cs
- CodeMethodReturnStatement.cs
- ConfigurationValue.cs
- BindingNavigatorDesigner.cs
- Pair.cs
- SafeSystemMetrics.cs
- XmlCodeExporter.cs
- HttpResponseInternalWrapper.cs
- DesignerTransaction.cs
- ConnectionInterfaceCollection.cs
- ReferenceEqualityComparer.cs
- TextTabProperties.cs
- SafeEventLogReadHandle.cs
- WindowsScroll.cs
- GeneralTransform3DTo2DTo3D.cs
- CodeAttributeDeclarationCollection.cs
- BasicExpandProvider.cs
- MDIClient.cs
- AppSecurityManager.cs
- PropertyMapper.cs
- SafeRightsManagementQueryHandle.cs
- BitmapData.cs
- FileStream.cs
- TextDecorationCollection.cs
- NGCSerializationManager.cs
- ProcessModule.cs
- MenuItem.cs
- ResourceIDHelper.cs
- TrustDriver.cs
- MenuItem.cs
- LogWriteRestartAreaState.cs
- XmlIlTypeHelper.cs