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
- SqlDataSourceFilteringEventArgs.cs
- NullableBoolConverter.cs
- SortKey.cs
- SemanticResultKey.cs
- ByteKeyFrameCollection.cs
- DragDeltaEventArgs.cs
- TypedTableHandler.cs
- TaiwanLunisolarCalendar.cs
- complextypematerializer.cs
- AtlasWeb.Designer.cs
- QuinticEase.cs
- WebScriptServiceHostFactory.cs
- CompositeDataBoundControl.cs
- DataReaderContainer.cs
- cookiecontainer.cs
- SecUtil.cs
- HtmlShimManager.cs
- Geometry3D.cs
- ProfileParameter.cs
- Base64Decoder.cs
- RoleService.cs
- OracleSqlParser.cs
- PlatformCulture.cs
- LogLogRecord.cs
- SqlResolver.cs
- StatusBarItemAutomationPeer.cs
- DataStreams.cs
- SettingsSection.cs
- ProgressBarHighlightConverter.cs
- AnnotationAdorner.cs
- XmlIncludeAttribute.cs
- DATA_BLOB.cs
- InvalidOleVariantTypeException.cs
- Transform3D.cs
- CollectionBase.cs
- ButtonStandardAdapter.cs
- ToolBar.cs
- EpmCustomContentWriterNodeData.cs
- XmlHierarchyData.cs
- DocumentGridContextMenu.cs
- XmlSerializerOperationFormatter.cs
- DataGridColumnStyleMappingNameEditor.cs
- PrintDialog.cs
- PaintEvent.cs
- AmbientEnvironment.cs
- IdleTimeoutMonitor.cs
- SrgsElementList.cs
- _AutoWebProxyScriptHelper.cs
- SelectionPattern.cs
- ObjectIDGenerator.cs
- OleDbMetaDataFactory.cs
- DataBoundControlHelper.cs
- DirectionalAction.cs
- Line.cs
- CellCreator.cs
- WebPartDescription.cs
- EnglishPluralizationService.cs
- DataList.cs
- XamlBuildProvider.cs
- StyleXamlTreeBuilder.cs
- GetBrowserTokenRequest.cs
- DataSourceControl.cs
- DependencyPropertyChangedEventArgs.cs
- DataGridViewCellParsingEventArgs.cs
- ScaleTransform3D.cs
- ObjectStateManager.cs
- ToolStripDropDownItem.cs
- SpellCheck.cs
- SynchronizedDispatch.cs
- DataKey.cs
- CheckBoxField.cs
- SendActivity.cs
- XmlBindingWorker.cs
- ConstructorExpr.cs
- SourceSwitch.cs
- PatternMatcher.cs
- IIS7UserPrincipal.cs
- Path.cs
- DataViewManagerListItemTypeDescriptor.cs
- CredentialCache.cs
- TableCellsCollectionEditor.cs
- ListSortDescriptionCollection.cs
- SamlAdvice.cs
- HttpApplicationFactory.cs
- Bitmap.cs
- ClientApiGenerator.cs
- IdentityReference.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DefaultBinder.cs
- RowTypeElement.cs
- XmlValueConverter.cs
- HybridWebProxyFinder.cs
- EntityDataSourceEntityTypeFilterItem.cs
- HandlerWithFactory.cs
- parserscommon.cs
- DebugTrace.cs
- DataSysAttribute.cs
- ISFClipboardData.cs
- CustomErrorsSectionWrapper.cs
- DbConnectionStringBuilder.cs