Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / ProcessActivityTreeOptions.cs / 1305376 / ProcessActivityTreeOptions.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Activities
{
using System.Collections.Generic;
using System.Activities.Validation;
using System.Runtime;
class ProcessActivityTreeOptions
{
static ProcessActivityTreeOptions validationOptions;
static ProcessActivityTreeOptions singleLevelValidationOptions;
static ProcessActivityTreeOptions fullCachingOptions;
static ProcessActivityTreeOptions finishCachingSubtreeOptionsWithCreateEmptyBindings;
static ProcessActivityTreeOptions finishCachingSubtreeOptionsWithoutCreateEmptyBindings;
ProcessActivityTreeOptions()
{
}
public static ProcessActivityTreeOptions FullCachingOptions
{
get
{
if (fullCachingOptions == null)
{
fullCachingOptions = new ProcessActivityTreeOptions
{
SkipIfCached = true,
CreateEmptyBindings = true,
OnlyCallCallbackForDeclarations = true
};
}
return fullCachingOptions;
}
}
public static ProcessActivityTreeOptions ValidationOptions
{
get
{
if (validationOptions == null)
{
validationOptions = new ProcessActivityTreeOptions
{
SkipPrivateChildren = false,
// We don't want to interfere with activities doing null-checks
// by creating empty bindings.
CreateEmptyBindings = false
};
}
return validationOptions;
}
}
static ProcessActivityTreeOptions SingleLevelValidationOptions
{
get
{
if (singleLevelValidationOptions == null)
{
singleLevelValidationOptions = new ProcessActivityTreeOptions
{
SkipPrivateChildren = false,
// We don't want to interfere with activities doing null-checks
// by creating empty bindings.
CreateEmptyBindings = false,
OnlyVisitSingleLevel = true
};
}
return singleLevelValidationOptions;
}
}
static ProcessActivityTreeOptions FinishCachingSubtreeOptionsWithoutCreateEmptyBindings
{
get
{
if (finishCachingSubtreeOptionsWithoutCreateEmptyBindings == null)
{
// We don't want to run constraints and we only want to hit
// the public path.
finishCachingSubtreeOptionsWithoutCreateEmptyBindings = new ProcessActivityTreeOptions
{
SkipConstraints = true,
StoreTempViolations = true
};
}
return finishCachingSubtreeOptionsWithoutCreateEmptyBindings;
}
}
static ProcessActivityTreeOptions FinishCachingSubtreeOptionsWithCreateEmptyBindings
{
get
{
if (finishCachingSubtreeOptionsWithCreateEmptyBindings == null)
{
// We don't want to run constraints and we only want to hit
// the public path.
finishCachingSubtreeOptionsWithCreateEmptyBindings = new ProcessActivityTreeOptions
{
SkipConstraints = true,
CreateEmptyBindings = true,
StoreTempViolations = true
};
}
return finishCachingSubtreeOptionsWithCreateEmptyBindings;
}
}
public static ProcessActivityTreeOptions GetFinishCachingSubtreeOptions(ProcessActivityTreeOptions originalOptions)
{
if (originalOptions.CreateEmptyBindings)
{
return ProcessActivityTreeOptions.FinishCachingSubtreeOptionsWithCreateEmptyBindings;
}
else
{
return ProcessActivityTreeOptions.FinishCachingSubtreeOptionsWithoutCreateEmptyBindings;
}
}
public static ProcessActivityTreeOptions GetValidationOptions(ValidationSettings settings)
{
if (settings.SingleLevel)
{
return ProcessActivityTreeOptions.SingleLevelValidationOptions;
}
else
{
return ProcessActivityTreeOptions.ValidationOptions;
}
}
public bool SkipIfCached
{
get;
private set;
}
public bool CreateEmptyBindings
{
get;
private set;
}
public bool SkipPrivateChildren
{
get;
private set;
}
public bool OnlyCallCallbackForDeclarations
{
get;
private set;
}
public bool SkipConstraints
{
get;
private set;
}
public bool OnlyVisitSingleLevel
{
get;
private set;
}
public bool StoreTempViolations
{
get;
private set;
}
public bool IsRuntimeReadyOptions
{
get
{
// We don't really support progressive caching at runtime so we only set ourselves
// as runtime ready if we cached the whole workflow and created empty bindings.
// In order to support progressive caching we need to deal with the following
// issues:
// * We need a mechanism for supporting activities which supply extensions
// * We need to understand when we haven't created empty bindings so that
// we can progressively create them
return !this.SkipPrivateChildren && this.CreateEmptyBindings;
}
}
}
}
// 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
- SqlDataSourceCommandEventArgs.cs
- PackageRelationship.cs
- SoapAttributeOverrides.cs
- FeatureSupport.cs
- DelegateArgumentReference.cs
- NativeWindow.cs
- ThemeDirectoryCompiler.cs
- MailDefinition.cs
- Atom10FormatterFactory.cs
- MetabaseServerConfig.cs
- JapaneseLunisolarCalendar.cs
- GridViewUpdateEventArgs.cs
- QilInvoke.cs
- ProxyWebPartManager.cs
- ReadOnlyPermissionSet.cs
- ReceiveMessageRecord.cs
- listviewsubitemcollectioneditor.cs
- MaskedTextBoxTextEditor.cs
- FixUp.cs
- util.cs
- _BaseOverlappedAsyncResult.cs
- XmlNamedNodeMap.cs
- ReadOnlyCollection.cs
- DataGridViewTopRowAccessibleObject.cs
- ProfileInfo.cs
- LabelAutomationPeer.cs
- XmlSchemaCompilationSettings.cs
- TreeNodeClickEventArgs.cs
- DesignerImageAdapter.cs
- DeflateStream.cs
- DropDownHolder.cs
- RowVisual.cs
- Vector3DAnimationBase.cs
- IssuanceLicense.cs
- FocusTracker.cs
- ParameterBuilder.cs
- SqlXmlStorage.cs
- RuleSettingsCollection.cs
- SqlDataSourceCache.cs
- XmlSignatureProperties.cs
- CodeTryCatchFinallyStatement.cs
- URLMembershipCondition.cs
- InvokeProviderWrapper.cs
- ServiceContractListItem.cs
- ListItemCollection.cs
- TableProviderWrapper.cs
- ProtectedConfiguration.cs
- StreamInfo.cs
- _LocalDataStoreMgr.cs
- ListControl.cs
- Base64Decoder.cs
- ComMethodElementCollection.cs
- Page.cs
- TextEndOfSegment.cs
- XmlEncodedRawTextWriter.cs
- ListViewUpdateEventArgs.cs
- DesignerUtility.cs
- ClonableStack.cs
- PageAction.cs
- ColorConvertedBitmap.cs
- SID.cs
- CreatingCookieEventArgs.cs
- HtmlControl.cs
- ReceiveParametersContent.cs
- ToolStripDropDown.cs
- DnsElement.cs
- RadioButton.cs
- SqlTriggerAttribute.cs
- PointKeyFrameCollection.cs
- HwndHostAutomationPeer.cs
- ReadOnlyTernaryTree.cs
- SQLDateTime.cs
- SqlTriggerContext.cs
- DllNotFoundException.cs
- EntityDataSource.cs
- Rect.cs
- GridViewEditEventArgs.cs
- ListenerAdapterBase.cs
- __Filters.cs
- LineMetrics.cs
- ChtmlLinkAdapter.cs
- XPathExpr.cs
- TextDecorationCollectionConverter.cs
- RootBrowserWindow.cs
- CodeVariableDeclarationStatement.cs
- BindingList.cs
- TypeConverterBase.cs
- DropDownList.cs
- ContentTextAutomationPeer.cs
- ClassGenerator.cs
- GlyphElement.cs
- QueryCacheManager.cs
- SymbolMethod.cs
- MatrixAnimationUsingPath.cs
- CodeArgumentReferenceExpression.cs
- ResourceBinder.cs
- Size3D.cs
- XmlName.cs
- RenderDataDrawingContext.cs
- AutoGeneratedField.cs