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
- FragmentQueryProcessor.cs
- ValueSerializerAttribute.cs
- ClientSponsor.cs
- AdRotator.cs
- TransactionCache.cs
- RectangleGeometry.cs
- BooleanSwitch.cs
- UrlPath.cs
- BitmapEffect.cs
- NeedSkipTokenVisitor.cs
- StrongNameIdentityPermission.cs
- querybuilder.cs
- SHA384.cs
- EventLogInternal.cs
- CodeSubDirectoriesCollection.cs
- TextParagraphProperties.cs
- SmiGettersStream.cs
- StatusBarPanelClickEvent.cs
- PolyQuadraticBezierSegment.cs
- BamlBinaryWriter.cs
- AsymmetricSignatureFormatter.cs
- ResizeGrip.cs
- StringPropertyBuilder.cs
- BufferedGraphicsContext.cs
- Literal.cs
- querybuilder.cs
- IdnElement.cs
- SimpleWebHandlerParser.cs
- DiscoveryInnerClientManaged11.cs
- CodeParameterDeclarationExpression.cs
- ActivityPropertyReference.cs
- RawUIStateInputReport.cs
- UpdateTracker.cs
- LineServicesRun.cs
- ConstructorExpr.cs
- SoapExtension.cs
- StoreContentChangedEventArgs.cs
- DataGridState.cs
- PartialTrustHelpers.cs
- ListDictionaryInternal.cs
- RegexReplacement.cs
- PropertyInfoSet.cs
- OleDbWrapper.cs
- TransactionFlowAttribute.cs
- RelationshipSet.cs
- TextServicesCompartmentEventSink.cs
- TransportReplyChannelAcceptor.cs
- EntityDataSourceReferenceGroup.cs
- MetaColumn.cs
- GC.cs
- TextPattern.cs
- DrawTreeNodeEventArgs.cs
- TextSerializer.cs
- NetCodeGroup.cs
- HebrewCalendar.cs
- FileLoadException.cs
- EntityClientCacheKey.cs
- StrongNamePublicKeyBlob.cs
- GeometryGroup.cs
- ValidationErrorCollection.cs
- pingexception.cs
- SpeechSeg.cs
- LineProperties.cs
- DataColumnChangeEvent.cs
- CompilerWrapper.cs
- TimeSpanConverter.cs
- ValidationSummary.cs
- RegexWriter.cs
- DeferredSelectedIndexReference.cs
- StrokeCollection2.cs
- TemplateInstanceAttribute.cs
- RenderTargetBitmap.cs
- CodeTypeParameter.cs
- ProvidersHelper.cs
- CodeStatementCollection.cs
- followingsibling.cs
- SimpleTypesSurrogate.cs
- TreeViewImageKeyConverter.cs
- AuthenticationManager.cs
- CanExpandCollapseAllConverter.cs
- _TimerThread.cs
- CompiledAction.cs
- ManagementInstaller.cs
- XmlUnspecifiedAttribute.cs
- SvcMapFileSerializer.cs
- DefaultAsyncDataDispatcher.cs
- DataServicePagingProviderWrapper.cs
- PeerEndPoint.cs
- _LazyAsyncResult.cs
- SHA256Managed.cs
- UxThemeWrapper.cs
- IPEndPoint.cs
- TextElementEnumerator.cs
- XmlTextReader.cs
- ObjectTypeMapping.cs
- ProtocolViolationException.cs
- SettingsAttributes.cs
- TextContainer.cs
- PrimitiveXmlSerializers.cs
- WindowsTooltip.cs