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
- DescendantBaseQuery.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Tokenizer.cs
- TraceUtility.cs
- BufferedReadStream.cs
- localization.cs
- MessageBuilder.cs
- ScrollItemPatternIdentifiers.cs
- SQLInt64Storage.cs
- WindowsListViewGroup.cs
- TraceListeners.cs
- Internal.cs
- DataServiceQueryProvider.cs
- CultureTable.cs
- TextEditorCharacters.cs
- SelectQueryOperator.cs
- AuthenticationServiceManager.cs
- mda.cs
- Trigger.cs
- DBBindings.cs
- CryptoKeySecurity.cs
- TcpChannelListener.cs
- TrackPoint.cs
- PostBackTrigger.cs
- DiscoveryDocumentReference.cs
- SqlErrorCollection.cs
- Queue.cs
- CodeBinaryOperatorExpression.cs
- DiscoveryDocumentSearchPattern.cs
- SessionStateContainer.cs
- MouseCaptureWithinProperty.cs
- XmlILAnnotation.cs
- CommonRemoteMemoryBlock.cs
- WmlControlAdapter.cs
- RecordBuilder.cs
- XmlMembersMapping.cs
- ItemsPresenter.cs
- DataControlCommands.cs
- WpfPayload.cs
- WebPartConnectionsDisconnectVerb.cs
- ApplyHostConfigurationBehavior.cs
- SqlErrorCollection.cs
- SessionStateUtil.cs
- ReferenceConverter.cs
- DataGrid.cs
- LinqDataSourceUpdateEventArgs.cs
- FtpWebResponse.cs
- FileSystemEventArgs.cs
- AuthenticationServiceManager.cs
- CellParagraph.cs
- ClockController.cs
- CultureTable.cs
- GradientBrush.cs
- UserPersonalizationStateInfo.cs
- ItemPager.cs
- NameValueSectionHandler.cs
- InfoCardAsymmetricCrypto.cs
- AmbientEnvironment.cs
- CommonDialog.cs
- HtmlTableRow.cs
- ScriptingScriptResourceHandlerSection.cs
- EntityContainerEmitter.cs
- ClientScriptManagerWrapper.cs
- LayoutEditorPart.cs
- AssertFilter.cs
- Base64Stream.cs
- ConfigXmlElement.cs
- JsonGlobals.cs
- SQLInt16.cs
- ADMembershipUser.cs
- SqlClientWrapperSmiStreamChars.cs
- WCFBuildProvider.cs
- XamlPointCollectionSerializer.cs
- UnsafeNativeMethods.cs
- ScaleTransform3D.cs
- CodeSnippetCompileUnit.cs
- ICspAsymmetricAlgorithm.cs
- WebConvert.cs
- InputLanguageSource.cs
- KeyTimeConverter.cs
- MediaScriptCommandRoutedEventArgs.cs
- BinaryParser.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- WindowsNonControl.cs
- Accessible.cs
- XmlSchemaComplexContent.cs
- EFAssociationProvider.cs
- UserControlCodeDomTreeGenerator.cs
- Visual.cs
- TableLayoutSettings.cs
- PrintingPermissionAttribute.cs
- MatcherBuilder.cs
- StructuredTypeEmitter.cs
- MachineKeyConverter.cs
- TextEvent.cs
- BitmapEffectGeneralTransform.cs
- BinaryConverter.cs
- BufferedGraphicsContext.cs
- DesignerSelectionListAdapter.cs
- SchemaCompiler.cs