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
- ModelItemExtensions.cs
- XmlNullResolver.cs
- CLRBindingWorker.cs
- HtmlWindowCollection.cs
- DesignParameter.cs
- JoinCqlBlock.cs
- HttpRawResponse.cs
- PointLightBase.cs
- TraceData.cs
- Positioning.cs
- SourceInterpreter.cs
- HandlerWithFactory.cs
- Rotation3DAnimationUsingKeyFrames.cs
- SafeFileHandle.cs
- UnauthorizedWebPart.cs
- StateManager.cs
- RefreshPropertiesAttribute.cs
- ScriptReferenceEventArgs.cs
- CompilerTypeWithParams.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- TemplateModeChangedEventArgs.cs
- DefaultBindingPropertyAttribute.cs
- ClientSideQueueItem.cs
- DiagnosticsConfiguration.cs
- VisemeEventArgs.cs
- InkCanvas.cs
- StaticContext.cs
- PtsHelper.cs
- ProfileSettingsCollection.cs
- sqlinternaltransaction.cs
- CompoundFileStreamReference.cs
- CodeCommentStatementCollection.cs
- AffineTransform3D.cs
- RtfToXamlReader.cs
- StringSource.cs
- ObjectContext.cs
- VisualBasicDesignerHelper.cs
- HttpConfigurationContext.cs
- Socket.cs
- CompiledQuery.cs
- ExpressionBinding.cs
- DataGridViewLayoutData.cs
- SqlConnection.cs
- peersecuritysettings.cs
- UInt16Converter.cs
- TextModifier.cs
- DateBoldEvent.cs
- OdbcException.cs
- PageAdapter.cs
- ListenerConstants.cs
- BuildManagerHost.cs
- DataGridViewCellStyleConverter.cs
- SecurityPolicySection.cs
- WorkflowDesignerMessageFilter.cs
- ResourceContainerWrapper.cs
- QueryConverter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ChannelManager.cs
- IssuanceLicense.cs
- activationcontext.cs
- GeneralTransform3DTo2D.cs
- PartitionedStream.cs
- TextStore.cs
- tibetanshape.cs
- StructuralType.cs
- WindowsRebar.cs
- HttpHeaderCollection.cs
- RepeaterCommandEventArgs.cs
- UrlAuthFailedErrorFormatter.cs
- BaseCollection.cs
- InternalEnumValidatorAttribute.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- WaitForChangedResult.cs
- ProfessionalColorTable.cs
- Baml6Assembly.cs
- RequiredFieldValidator.cs
- DataGridState.cs
- BlurEffect.cs
- TextClipboardData.cs
- IndexedString.cs
- WaitForChangedResult.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- XsltConvert.cs
- XmlReader.cs
- TabControlEvent.cs
- DependencyPropertyChangedEventArgs.cs
- ExpressionParser.cs
- HtmlShimManager.cs
- ZeroOpNode.cs
- BamlResourceSerializer.cs
- CategoryGridEntry.cs
- ScrollContentPresenter.cs
- SelectionRangeConverter.cs
- QueueProcessor.cs
- BidirectionalDictionary.cs
- XmlElementList.cs
- ProgressBarHighlightConverter.cs
- SafeFileMapViewHandle.cs
- COAUTHINFO.cs
- ServiceDiscoveryBehavior.cs