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
- EdmRelationshipNavigationPropertyAttribute.cs
- EditorResources.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- RecipientInfo.cs
- XmlSchemaChoice.cs
- CacheOutputQuery.cs
- ImpersonateTokenRef.cs
- ArraySubsetEnumerator.cs
- _TimerThread.cs
- VirtualDirectoryMapping.cs
- ViewLoader.cs
- ButtonFieldBase.cs
- PersonalizationState.cs
- TileBrush.cs
- PointConverter.cs
- NamespaceMapping.cs
- DocumentXPathNavigator.cs
- TopClause.cs
- XPathMultyIterator.cs
- TextFormattingConverter.cs
- PolyBezierSegment.cs
- ListViewUpdatedEventArgs.cs
- ConfigXmlAttribute.cs
- PageRequestManager.cs
- WebCodeGenerator.cs
- RouteData.cs
- BrowserCapabilitiesCodeGenerator.cs
- CalendarTable.cs
- UIElementParaClient.cs
- XamlReader.cs
- CustomPopupPlacement.cs
- ListViewTableRow.cs
- TextMarkerSource.cs
- ISAPIWorkerRequest.cs
- GenericUriParser.cs
- DateTimeConverter2.cs
- MediaContextNotificationWindow.cs
- FixedLineResult.cs
- WindowsSolidBrush.cs
- BamlRecordReader.cs
- RadioButton.cs
- Size3DConverter.cs
- Axis.cs
- PathParser.cs
- SymmetricAlgorithm.cs
- RectAnimationBase.cs
- _DisconnectOverlappedAsyncResult.cs
- WpfPayload.cs
- AutoCompleteStringCollection.cs
- XPathDocument.cs
- WindowsPrincipal.cs
- coordinatorscratchpad.cs
- Brushes.cs
- ListBoxItemAutomationPeer.cs
- Converter.cs
- Currency.cs
- SQLInt16Storage.cs
- MetadataArtifactLoader.cs
- EntityConnection.cs
- ImageDesigner.cs
- OrthographicCamera.cs
- KeySpline.cs
- DataServiceContext.cs
- DBNull.cs
- EnvironmentPermission.cs
- PerfCounters.cs
- ViewValidator.cs
- _CacheStreams.cs
- FrameworkName.cs
- CfgParser.cs
- XmlSchemaElement.cs
- TemplateBindingExpressionConverter.cs
- SqlBuffer.cs
- AttributeInfo.cs
- UnknownBitmapEncoder.cs
- StateRuntime.cs
- DataKeyCollection.cs
- DataPointer.cs
- CompiledQuery.cs
- SqlBuilder.cs
- ErrorFormatter.cs
- CodeDomConfigurationHandler.cs
- TableLayoutPanelCodeDomSerializer.cs
- mda.cs
- XPathDescendantIterator.cs
- HiddenFieldDesigner.cs
- HelpKeywordAttribute.cs
- DSGeneratorProblem.cs
- MatrixTransform.cs
- Setter.cs
- VisualTransition.cs
- StylusEventArgs.cs
- StandardToolWindows.cs
- PersonalizableAttribute.cs
- MetaType.cs
- KeyboardEventArgs.cs
- EventLogRecord.cs
- dataprotectionpermissionattribute.cs
- TypeLibConverter.cs
- XmlDownloadManager.cs