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
- SqlProcedureAttribute.cs
- ArithmeticException.cs
- HtmlElementCollection.cs
- TypeUtils.cs
- BooleanAnimationBase.cs
- DetailsViewPagerRow.cs
- CommunicationObjectAbortedException.cs
- CommandEventArgs.cs
- SplineKeyFrames.cs
- Hyperlink.cs
- cookieexception.cs
- RowBinding.cs
- MailMessageEventArgs.cs
- SafePEFileHandle.cs
- PageParserFilter.cs
- TrackingProfile.cs
- RemoveFromCollection.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- WindowInteractionStateTracker.cs
- HttpHeaderCollection.cs
- CollectionContainer.cs
- CompilerInfo.cs
- BitmapEffectGroup.cs
- SqlColumnizer.cs
- VSDExceptions.cs
- DbConvert.cs
- ListParagraph.cs
- DataGridPagerStyle.cs
- FilterQueryOptionExpression.cs
- SplitterPanel.cs
- UserControlBuildProvider.cs
- TreeViewItemAutomationPeer.cs
- SqlDelegatedTransaction.cs
- EDesignUtil.cs
- JsonStringDataContract.cs
- CodeCommentStatement.cs
- IconConverter.cs
- StackSpiller.Temps.cs
- ListChunk.cs
- FixUpCollection.cs
- IndicShape.cs
- BitFlagsGenerator.cs
- ExternalException.cs
- XmlLinkedNode.cs
- DateTimeSerializationSection.cs
- QueryContinueDragEventArgs.cs
- DES.cs
- SystemPens.cs
- Queue.cs
- DocumentsTrace.cs
- DocumentXmlWriter.cs
- NameScopePropertyAttribute.cs
- GenericIdentity.cs
- AsyncDataRequest.cs
- SqlMetaData.cs
- ListViewSortEventArgs.cs
- WinCategoryAttribute.cs
- CallbackDebugBehavior.cs
- HtmlInputButton.cs
- StreamUpgradeInitiator.cs
- RequestStatusBarUpdateEventArgs.cs
- MultiTrigger.cs
- Transform3DCollection.cs
- DataGridColumn.cs
- HtmlAnchor.cs
- PathFigure.cs
- WebPartTransformerAttribute.cs
- VersionUtil.cs
- AnimationException.cs
- Bold.cs
- Calendar.cs
- ManagementException.cs
- LayoutTableCell.cs
- LazyTextWriterCreator.cs
- XmlKeywords.cs
- BindingGroup.cs
- XmlDictionaryWriter.cs
- AutoResizedEvent.cs
- TextRenderer.cs
- BasePropertyDescriptor.cs
- SAPICategories.cs
- RelatedCurrencyManager.cs
- SymbolDocumentInfo.cs
- IdentitySection.cs
- CommandEventArgs.cs
- ControlOperationBehavior.cs
- DataGridViewHitTestInfo.cs
- NamedPipeAppDomainProtocolHandler.cs
- VSWCFServiceContractGenerator.cs
- SqlDataSourceStatusEventArgs.cs
- CompoundFileReference.cs
- CommandConverter.cs
- DiscoveryClientOutputChannel.cs
- TcpClientSocketManager.cs
- KeyEvent.cs
- TraceHandler.cs
- IgnoreFlushAndCloseStream.cs
- AppDomainAttributes.cs
- DataGridViewCellPaintingEventArgs.cs
- PersonalizableAttribute.cs