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
- DataGridTablesFactory.cs
- SafeLocalMemHandle.cs
- DataTable.cs
- WindowInteropHelper.cs
- CaseCqlBlock.cs
- SqlDataSourceView.cs
- DCSafeHandle.cs
- SvcMapFile.cs
- PopupControlService.cs
- ExtendedPropertyDescriptor.cs
- BuildProviderAppliesToAttribute.cs
- RelatedImageListAttribute.cs
- LabelEditEvent.cs
- HtmlInputButton.cs
- WebControl.cs
- SortFieldComparer.cs
- EnumerationRangeValidationUtil.cs
- GPRECT.cs
- LinqTreeNodeEvaluator.cs
- SchemaTypeEmitter.cs
- DbConnectionOptions.cs
- DataGridColumnEventArgs.cs
- DbException.cs
- MarkupObject.cs
- elementinformation.cs
- coordinator.cs
- ReferenceEqualityComparer.cs
- SerializationEventsCache.cs
- ReferencedCollectionType.cs
- CodeTypeReferenceExpression.cs
- safex509handles.cs
- ResourceDefaultValueAttribute.cs
- ExpressionBuilderContext.cs
- ParentControlDesigner.cs
- Vector3DAnimationUsingKeyFrames.cs
- AttributeExtensions.cs
- AsyncStreamReader.cs
- WebPartDisplayModeEventArgs.cs
- DependencyPropertyAttribute.cs
- DNS.cs
- ClassHandlersStore.cs
- EmptyEnumerator.cs
- UnsafeNativeMethods.cs
- ProcessModelSection.cs
- RemoveFromCollection.cs
- ListView.cs
- DataGridViewCellStyleChangedEventArgs.cs
- EntityParameterCollection.cs
- PropertyDescriptorGridEntry.cs
- WeakReferenceKey.cs
- SQLCharsStorage.cs
- WindowsProgressbar.cs
- QueryCursorEventArgs.cs
- GrowingArray.cs
- DataGridViewMethods.cs
- EventLogEntryCollection.cs
- AssemblyAttributes.cs
- GC.cs
- DocumentViewerHelper.cs
- LinkTarget.cs
- CalendarTable.cs
- ClassicBorderDecorator.cs
- SignatureDescription.cs
- MaskDesignerDialog.cs
- WpfKnownMember.cs
- GridViewUpdatedEventArgs.cs
- SettingsAttributes.cs
- Math.cs
- MissingMemberException.cs
- ReaderWriterLockWrapper.cs
- SourceSwitch.cs
- Socket.cs
- XmlSerializationGeneratedCode.cs
- RegionInfo.cs
- DelegateSerializationHolder.cs
- HitTestResult.cs
- ImportOptions.cs
- TraceData.cs
- ContextStaticAttribute.cs
- CompilerParameters.cs
- securitycriticaldataClass.cs
- WebServiceClientProxyGenerator.cs
- ServiceDiscoveryBehavior.cs
- SettingsPropertyIsReadOnlyException.cs
- LocatorPartList.cs
- ChannelDemuxer.cs
- _SSPISessionCache.cs
- StateManagedCollection.cs
- PostBackOptions.cs
- Stream.cs
- SocketPermission.cs
- DrawingGroup.cs
- OdbcStatementHandle.cs
- GlyphCollection.cs
- XmlAnyElementAttribute.cs
- IPGlobalProperties.cs
- ObservableCollectionDefaultValueFactory.cs
- PtsContext.cs
- TextFormatterHost.cs
- DataMisalignedException.cs