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
- Select.cs
- PersonalizationStateQuery.cs
- Missing.cs
- StateElement.cs
- _AuthenticationState.cs
- DirectoryNotFoundException.cs
- ImageCodecInfoPrivate.cs
- ItemChangedEventArgs.cs
- HtmlInputButton.cs
- StringBuilder.cs
- ECDiffieHellmanCng.cs
- EntityClientCacheKey.cs
- ValidatorCompatibilityHelper.cs
- EmbeddedMailObject.cs
- WrapperEqualityComparer.cs
- DesignTimeData.cs
- CompositeControl.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- ScrollBar.cs
- WebPartMenuStyle.cs
- TableLayout.cs
- PointAnimation.cs
- X509UI.cs
- TcpStreams.cs
- _NegotiateClient.cs
- Transform3DGroup.cs
- FormViewUpdatedEventArgs.cs
- TypeConverters.cs
- Proxy.cs
- MemoryStream.cs
- Point3DCollectionConverter.cs
- TemplatedMailWebEventProvider.cs
- ToolBarTray.cs
- WebServiceEnumData.cs
- FileDialogCustomPlace.cs
- handlecollector.cs
- ProgressBarBrushConverter.cs
- ADConnectionHelper.cs
- EventLogEntry.cs
- LocalBuilder.cs
- SafeNativeMethods.cs
- SynchronizationContext.cs
- SafeProcessHandle.cs
- ListBoxItemAutomationPeer.cs
- BordersPage.cs
- WebPartMenuStyle.cs
- MobileControlsSectionHelper.cs
- EncoderExceptionFallback.cs
- ThumbAutomationPeer.cs
- MergeExecutor.cs
- View.cs
- CodeSnippetTypeMember.cs
- Math.cs
- recordstate.cs
- NumericUpDownAccelerationCollection.cs
- UrlPath.cs
- TransformPatternIdentifiers.cs
- HtmlInputText.cs
- ProjectionPruner.cs
- AppDomain.cs
- validation.cs
- PointValueSerializer.cs
- PageSettings.cs
- FrugalMap.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DateTimeConverter2.cs
- SingletonChannelAcceptor.cs
- RelativeSource.cs
- Decorator.cs
- DBConnectionString.cs
- UnSafeCharBuffer.cs
- SiteMapDataSourceDesigner.cs
- NativeActivityTransactionContext.cs
- XpsTokenContext.cs
- QilPatternVisitor.cs
- TextEmbeddedObject.cs
- DataColumnMappingCollection.cs
- HttpRuntime.cs
- Rect.cs
- Rotation3DKeyFrameCollection.cs
- CompilerInfo.cs
- SortedDictionary.cs
- ParameterToken.cs
- PropertyInformation.cs
- SqlInternalConnectionTds.cs
- OleDbSchemaGuid.cs
- PropertyHelper.cs
- serverconfig.cs
- ReaderContextStackData.cs
- MultiDataTrigger.cs
- WebPartExportVerb.cs
- BStrWrapper.cs
- PrimarySelectionGlyph.cs
- XamlStyleSerializer.cs
- ThreadNeutralSemaphore.cs
- COM2Enum.cs
- IdentifierService.cs
- ListViewCommandEventArgs.cs
- JsonUriDataContract.cs
- XPathNavigator.cs