Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // 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
- Region.cs
- SqlErrorCollection.cs
- ByteFacetDescriptionElement.cs
- IERequestCache.cs
- Size.cs
- ProtocolElementCollection.cs
- DbParameterCollection.cs
- NumericUpDownAcceleration.cs
- CngAlgorithm.cs
- SchemaNames.cs
- ControlPager.cs
- QueryCursorEventArgs.cs
- SafeHandles.cs
- CommandBinding.cs
- GeneralTransform3DTo2D.cs
- FreezableCollection.cs
- DataBoundControlAdapter.cs
- TimerElapsedEvenArgs.cs
- UnitySerializationHolder.cs
- DistributedTransactionPermission.cs
- XDRSchema.cs
- StartUpEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- URLMembershipCondition.cs
- NotifyCollectionChangedEventArgs.cs
- HierarchicalDataBoundControlAdapter.cs
- FlowDocumentReaderAutomationPeer.cs
- X509CertificateTrustedIssuerElement.cs
- DetailsViewRowCollection.cs
- BitmapEffectRenderDataResource.cs
- ProviderManager.cs
- BinarySerializer.cs
- TdsParameterSetter.cs
- SoapSchemaMember.cs
- RadialGradientBrush.cs
- WindowsTooltip.cs
- XmlResolver.cs
- DeflateEmulationStream.cs
- DtrList.cs
- EncodingNLS.cs
- ElementAction.cs
- ClientRolePrincipal.cs
- MILUtilities.cs
- ECDiffieHellmanCng.cs
- SchemaInfo.cs
- Animatable.cs
- ControlPaint.cs
- StringSource.cs
- LocationUpdates.cs
- PointCollection.cs
- DataSourceControlBuilder.cs
- DatatypeImplementation.cs
- BasicCommandTreeVisitor.cs
- ResourceReferenceExpression.cs
- LeaseManager.cs
- ServiceDescriptionContext.cs
- RemotingSurrogateSelector.cs
- DataPagerFieldCommandEventArgs.cs
- BaseHashHelper.cs
- TypedElement.cs
- MimeWriter.cs
- StrongNameMembershipCondition.cs
- Char.cs
- BitmapVisualManager.cs
- ProcessManager.cs
- LineServicesRun.cs
- Interlocked.cs
- FixedSOMPageConstructor.cs
- SafeFindHandle.cs
- XmlName.cs
- RangeExpression.cs
- WebCategoryAttribute.cs
- ExpressionConverter.cs
- WebPartConnectionsCancelVerb.cs
- XmlQueryStaticData.cs
- Attributes.cs
- XmlToDatasetMap.cs
- PreProcessInputEventArgs.cs
- OdbcErrorCollection.cs
- InputLanguageProfileNotifySink.cs
- MetadataExchangeBindings.cs
- WindowsListViewGroupSubsetLink.cs
- CryptoApi.cs
- ArgumentReference.cs
- SplashScreenNativeMethods.cs
- ForwardPositionQuery.cs
- DataGridHelper.cs
- Rule.cs
- RecognitionResult.cs
- DelegatingConfigHost.cs
- SizeAnimationBase.cs
- LinearKeyFrames.cs
- CodeTypeConstructor.cs
- _ShellExpression.cs
- DataQuery.cs
- ToolBarPanel.cs
- NotEqual.cs
- _Events.cs
- XappLauncher.cs
- Ops.cs