Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / CorrelationScope.cs / 1305376 / CorrelationScope.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Activities { using System.Activities; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.Collections; // The correlation scope has to derive from NativeActivity // so that we can access execution properties from AEC. // public class CorrelationScope : NativeActivity { VariabledeclaredHandle; // public CorrelationScope() : base() { this.declaredHandle = new Variable (); } // Explicit correlation OM public InArgument CorrelatesWith { get; set; } public Activity Body { get; set; } protected override void CacheMetadata(NativeActivityMetadata metadata) { metadata.AddChild(this.Body); metadata.SetImplementationVariablesCollection( new Collection { this.declaredHandle }); RuntimeArgument correlatesWithArgument = new RuntimeArgument("CorrelatesWith", typeof(CorrelationHandle), ArgumentDirection.In); metadata.Bind(this.CorrelatesWith, correlatesWithArgument); metadata.SetArgumentsCollection(new Collection { correlatesWithArgument }); } protected override void Execute(NativeActivityContext context) { if (this.Body != null) { CorrelationHandle ambientHandle = null; if (this.CorrelatesWith != null && this.CorrelatesWith.Expression != null) { ambientHandle = this.CorrelatesWith.Get(context); } if (ambientHandle == null) { ambientHandle = this.declaredHandle.Get(context); } context.Properties.Add(CorrelationHandle.StaticExecutionPropertyName, ambientHandle); context.ScheduleActivity(this.Body); } } [EditorBrowsable(EditorBrowsableState.Never)] public bool ShouldSerializeCorrelatesWith() { return this.CorrelatesWith != null && this.CorrelatesWith.Expression != null; } } } // 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
- IdnElement.cs
- StatusCommandUI.cs
- ActiveDesignSurfaceEvent.cs
- PlacementWorkspace.cs
- SqlVersion.cs
- RevocationPoint.cs
- DetailsViewRowCollection.cs
- PointAnimationUsingPath.cs
- safelinkcollection.cs
- X509SecurityTokenProvider.cs
- Restrictions.cs
- InternalControlCollection.cs
- FusionWrap.cs
- DropSource.cs
- DescendentsWalker.cs
- ObjectDataSourceMethodEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- SignatureToken.cs
- EventlogProvider.cs
- ConstraintConverter.cs
- DomainUpDown.cs
- EdmFunctionAttribute.cs
- CodeConditionStatement.cs
- RadioButtonStandardAdapter.cs
- CodeObject.cs
- SafeMemoryMappedViewHandle.cs
- ToolTip.cs
- HTMLTagNameToTypeMapper.cs
- xsdvalidator.cs
- FormsAuthenticationUser.cs
- PixelFormats.cs
- InternalTypeHelper.cs
- autovalidator.cs
- COM2FontConverter.cs
- ChangeDirector.cs
- PermissionSetTriple.cs
- SimpleHandlerBuildProvider.cs
- UmAlQuraCalendar.cs
- ResourceProperty.cs
- DataSourceCacheDurationConverter.cs
- DebugView.cs
- BlurEffect.cs
- TrackPointCollection.cs
- RouteParameter.cs
- ThreadSafeList.cs
- AddInStore.cs
- PersonalizationDictionary.cs
- GridViewCommandEventArgs.cs
- EpmContentDeSerializer.cs
- ProfileParameter.cs
- DocumentGridContextMenu.cs
- RequiredFieldValidator.cs
- AdPostCacheSubstitution.cs
- ValidationHelper.cs
- FrugalMap.cs
- XsdBuildProvider.cs
- CatchDesigner.xaml.cs
- mediaeventargs.cs
- DeleteIndexBinder.cs
- lengthconverter.cs
- HttpCapabilitiesEvaluator.cs
- SafeReversePInvokeHandle.cs
- XmlHierarchyData.cs
- ComponentChangedEvent.cs
- WebBaseEventKeyComparer.cs
- ComponentConverter.cs
- QilTypeChecker.cs
- UnsafeNativeMethods.cs
- DbProviderSpecificTypePropertyAttribute.cs
- UnionExpr.cs
- RegexStringValidator.cs
- DataGridView.cs
- TextTreeTextBlock.cs
- PenLineJoinValidation.cs
- ArrayWithOffset.cs
- NullableConverter.cs
- XmlJsonReader.cs
- Debugger.cs
- XmlByteStreamWriter.cs
- ExpressionBuilderContext.cs
- GC.cs
- TokenBasedSet.cs
- SqlMethods.cs
- EdmFunctionAttribute.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- Form.cs
- Screen.cs
- log.cs
- SamlDelegatingWriter.cs
- AnonymousIdentificationModule.cs
- StatusBarDrawItemEvent.cs
- safePerfProviderHandle.cs
- MethodSet.cs
- FixedMaxHeap.cs
- Int32AnimationBase.cs
- DispatcherEventArgs.cs
- _Events.cs
- EntityDataSourceEntityTypeFilterItem.cs
- VectorCollection.cs
- EntityTemplateUserControl.cs