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
- BoolExpr.cs
- BackStopAuthenticationModule.cs
- ConstraintStruct.cs
- wmiprovider.cs
- RoutedEventValueSerializer.cs
- AssemblyUtil.cs
- CreateUserWizard.cs
- ScriptRegistrationManager.cs
- TreeNodeClickEventArgs.cs
- XmlSchemaSimpleContentExtension.cs
- CalculatedColumn.cs
- XmlSchemaImport.cs
- EmptyCollection.cs
- ProviderConnectionPointCollection.cs
- ProxyAttribute.cs
- ListViewTableCell.cs
- DynamicControl.cs
- EraserBehavior.cs
- __ConsoleStream.cs
- SqlCacheDependencySection.cs
- CompModHelpers.cs
- LoginName.cs
- XmlDocumentType.cs
- ValueTable.cs
- SchemaImporterExtension.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- AliasGenerator.cs
- XmlComment.cs
- NullNotAllowedCollection.cs
- ConfigurationElementProperty.cs
- XmlAnyAttributeAttribute.cs
- COM2EnumConverter.cs
- MenuItemBindingCollection.cs
- BitVector32.cs
- ProxyWebPartManager.cs
- GB18030Encoding.cs
- InputLangChangeEvent.cs
- HttpApplicationFactory.cs
- TransformDescriptor.cs
- FastPropertyAccessor.cs
- ConsumerConnectionPointCollection.cs
- MarkupCompilePass1.cs
- ParallelTimeline.cs
- IndicCharClassifier.cs
- RootBuilder.cs
- LocalClientSecuritySettings.cs
- MenuItemBindingCollection.cs
- _ScatterGatherBuffers.cs
- LinkButton.cs
- DialogResultConverter.cs
- NamespaceCollection.cs
- DataKeyArray.cs
- XmlArrayItemAttribute.cs
- PolyQuadraticBezierSegment.cs
- ObjectPersistData.cs
- BackgroundWorker.cs
- FigureParaClient.cs
- Inline.cs
- SystemIPGlobalProperties.cs
- StrokeFIndices.cs
- JavaScriptObjectDeserializer.cs
- StringReader.cs
- SvcMapFileSerializer.cs
- PerCallInstanceContextProvider.cs
- DataGridViewSortCompareEventArgs.cs
- PeerNameRegistration.cs
- SecurityManager.cs
- GenericEnumerator.cs
- CmsInterop.cs
- ObjectDataSourceDisposingEventArgs.cs
- DesignerHelpers.cs
- DefaultValidator.cs
- safex509handles.cs
- util.cs
- EntityDataSourceView.cs
- dbdatarecord.cs
- DiscoveryEndpoint.cs
- XmlAnyElementAttributes.cs
- ChangePassword.cs
- RegexInterpreter.cs
- EditingScope.cs
- PointLight.cs
- WebBrowserSiteBase.cs
- NativeWrapper.cs
- Simplifier.cs
- Timer.cs
- IdleTimeoutMonitor.cs
- BridgeDataRecord.cs
- MediaElement.cs
- DataGridViewColumnCollection.cs
- SectionRecord.cs
- AdRotator.cs
- MessageCredentialType.cs
- MenuItemStyle.cs
- basecomparevalidator.cs
- WmfPlaceableFileHeader.cs
- PartitionedStream.cs
- AspProxy.cs
- EnvelopedSignatureTransform.cs
- Listen.cs