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
- SegmentTree.cs
- ReliabilityContractAttribute.cs
- PageThemeBuildProvider.cs
- StringArrayConverter.cs
- SharedPerformanceCounter.cs
- ScriptRegistrationManager.cs
- DeflateEmulationStream.cs
- ScriptBehaviorDescriptor.cs
- TrackingProfileCache.cs
- RectangleConverter.cs
- DataServiceRequestException.cs
- SessionPageStateSection.cs
- AsyncResult.cs
- XamlTreeBuilderBamlRecordWriter.cs
- AtomEntry.cs
- CultureInfoConverter.cs
- SoapReflectionImporter.cs
- XmlDictionaryWriter.cs
- StyleModeStack.cs
- DesignerLabelAdapter.cs
- BitSet.cs
- PageSetupDialog.cs
- PeerTransportBindingElement.cs
- SortDescriptionCollection.cs
- SecurityValidationBehavior.cs
- NamedPermissionSet.cs
- XMLSyntaxException.cs
- ConfigXmlText.cs
- DataGridViewAddColumnDialog.cs
- JsonEncodingStreamWrapper.cs
- EntityDataSourceQueryBuilder.cs
- GridViewSelectEventArgs.cs
- CodePropertyReferenceExpression.cs
- PropertyGridView.cs
- CompiledQueryCacheEntry.cs
- MembershipUser.cs
- ListViewGroup.cs
- DesignerActionList.cs
- HtmlImageAdapter.cs
- KeyEvent.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- WebExceptionStatus.cs
- DataGridViewBindingCompleteEventArgs.cs
- DataReaderContainer.cs
- DbConnectionPoolCounters.cs
- PropertyToken.cs
- DispatcherTimer.cs
- OciHandle.cs
- PageAdapter.cs
- ViewGenerator.cs
- DuplicateWaitObjectException.cs
- DefaultValueTypeConverter.cs
- UIElement3D.cs
- URLEditor.cs
- SafeArrayTypeMismatchException.cs
- FileIOPermission.cs
- HtmlInputControl.cs
- PropertyEmitter.cs
- MdiWindowListItemConverter.cs
- MsmqException.cs
- Int16AnimationBase.cs
- IsolatedStoragePermission.cs
- EntityDataSourceDesignerHelper.cs
- TrackingAnnotationCollection.cs
- Vector3D.cs
- CssTextWriter.cs
- IgnoreSection.cs
- SqlTypeConverter.cs
- DependencyPropertyValueSerializer.cs
- TypefaceMap.cs
- PolicyChain.cs
- TagMapInfo.cs
- SafeHandle.cs
- NameValuePermission.cs
- WebHttpBindingCollectionElement.cs
- TextSimpleMarkerProperties.cs
- TdsEnums.cs
- wgx_render.cs
- BinaryReader.cs
- Renderer.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- DBParameter.cs
- TreeNodeCollection.cs
- CroppedBitmap.cs
- LineInfo.cs
- GridViewDeleteEventArgs.cs
- GetPageCompletedEventArgs.cs
- CursorConverter.cs
- UIElement.cs
- SecuritySessionSecurityTokenProvider.cs
- HttpApplicationFactory.cs
- MessageProtectionOrder.cs
- DictionaryBase.cs
- NullableDecimalMinMaxAggregationOperator.cs
- MenuItem.cs
- RoleService.cs
- ClientFormsAuthenticationCredentials.cs
- ResizeGrip.cs
- AuthenticationManager.cs
- _TLSstream.cs