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
- PersonalizableTypeEntry.cs
- DBSqlParserColumn.cs
- XmlValueConverter.cs
- OptimizedTemplateContent.cs
- DataExpression.cs
- IdentityVerifier.cs
- RegexCode.cs
- DataServiceBuildProvider.cs
- ArithmeticException.cs
- ObjectViewFactory.cs
- WebPartConnection.cs
- AnnotationAuthorChangedEventArgs.cs
- XmlUrlResolver.cs
- TokenBasedSet.cs
- HeaderCollection.cs
- PreviewPageInfo.cs
- NextPreviousPagerField.cs
- XPathExpr.cs
- MsmqChannelListenerBase.cs
- XmlSchemaAppInfo.cs
- WindowsFormsHost.cs
- SpeechEvent.cs
- PageParser.cs
- Tokenizer.cs
- RegexCaptureCollection.cs
- DoubleAnimationUsingPath.cs
- Stopwatch.cs
- MessageDecoder.cs
- SessionState.cs
- WebErrorHandler.cs
- SoapElementAttribute.cs
- FtpCachePolicyElement.cs
- BufferedStream.cs
- DynamicPropertyReader.cs
- CatalogZoneAutoFormat.cs
- NullableFloatAverageAggregationOperator.cs
- ZipIOExtraFieldPaddingElement.cs
- Substitution.cs
- ControlCollection.cs
- ServiceDiscoveryBehavior.cs
- AttributeQuery.cs
- ModelItemExtensions.cs
- bindurihelper.cs
- LogicalExpressionEditor.cs
- SystemIPAddressInformation.cs
- DocumentSequence.cs
- UTF7Encoding.cs
- XmlSchemaProviderAttribute.cs
- FormViewModeEventArgs.cs
- ReadOnlyNameValueCollection.cs
- ProfessionalColors.cs
- StreamUpdate.cs
- BitmapCodecInfo.cs
- OraclePermissionAttribute.cs
- CodeLinePragma.cs
- xml.cs
- GeneratedCodeAttribute.cs
- HtmlInputPassword.cs
- QualificationDataItem.cs
- WorkflowRuntime.cs
- NumericUpDownAccelerationCollection.cs
- DependencyPropertyConverter.cs
- PageStatePersister.cs
- TimerEventSubscription.cs
- PrintDialog.cs
- ActivityBindForm.cs
- HttpEncoderUtility.cs
- CompilerLocalReference.cs
- LinqExpressionNormalizer.cs
- GridViewUpdatedEventArgs.cs
- TransactionScope.cs
- TextSelectionHelper.cs
- FactoryMaker.cs
- EventsTab.cs
- Walker.cs
- DispatcherTimer.cs
- KeyFrames.cs
- SqlOuterApplyReducer.cs
- ProjectionPlan.cs
- ParseNumbers.cs
- _SecureChannel.cs
- PersistChildrenAttribute.cs
- SqlDataAdapter.cs
- OracleCommandBuilder.cs
- CustomAssemblyResolver.cs
- CompositeFontInfo.cs
- XsdBuilder.cs
- XmlComment.cs
- DataGridViewLinkCell.cs
- PictureBoxDesigner.cs
- SerializationTrace.cs
- PreviewKeyDownEventArgs.cs
- DbProviderServices.cs
- VarInfo.cs
- IconEditor.cs
- TransformerInfoCollection.cs
- SqlParameter.cs
- ProtocolsConfiguration.cs
- RangeContentEnumerator.cs
- CommandHelpers.cs