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
- TemplateInstanceAttribute.cs
- PostBackOptions.cs
- CultureSpecificCharacterBufferRange.cs
- HybridDictionary.cs
- TriggerBase.cs
- AssertSection.cs
- TextReturnReader.cs
- XmlEncodedRawTextWriter.cs
- ToolTipService.cs
- DataGrid.cs
- GridEntry.cs
- BlurBitmapEffect.cs
- CrossSiteScriptingValidation.cs
- PointConverter.cs
- DataTableNewRowEvent.cs
- CaretElement.cs
- MsmqInputChannelListener.cs
- Utils.cs
- SoapEnumAttribute.cs
- PageRequestManager.cs
- PointAnimationUsingKeyFrames.cs
- FillRuleValidation.cs
- OleDbException.cs
- SqlUDTStorage.cs
- TypeUsage.cs
- x509utils.cs
- TrackingMemoryStreamFactory.cs
- MatrixIndependentAnimationStorage.cs
- PackWebResponse.cs
- DataGridViewCellLinkedList.cs
- ServiceElement.cs
- AppDomainProtocolHandler.cs
- ToolStripActionList.cs
- ValueUnavailableException.cs
- DataObjectMethodAttribute.cs
- RangeContentEnumerator.cs
- MobileUITypeEditor.cs
- ToolStripPanelRow.cs
- PointHitTestParameters.cs
- DPAPIProtectedConfigurationProvider.cs
- SmtpLoginAuthenticationModule.cs
- DataSourceHelper.cs
- LinqDataSourceDisposeEventArgs.cs
- PointLight.cs
- BitHelper.cs
- QueryCacheKey.cs
- TraceSwitch.cs
- ManagementObject.cs
- TextRangeAdaptor.cs
- RoleManagerEventArgs.cs
- AmbientLight.cs
- CSharpCodeProvider.cs
- ModelItemKeyValuePair.cs
- SQLStringStorage.cs
- IssuanceLicense.cs
- XmlTextReaderImplHelpers.cs
- DataGridViewTextBoxColumn.cs
- StrokeNodeOperations2.cs
- XmlWriter.cs
- TextEncodedRawTextWriter.cs
- DSACryptoServiceProvider.cs
- SynchronizationLockException.cs
- GeneralTransformGroup.cs
- FontWeights.cs
- ToolStripContentPanel.cs
- BaseTreeIterator.cs
- PathTooLongException.cs
- ThreadAbortException.cs
- DbParameterHelper.cs
- EncodingNLS.cs
- StdValidatorsAndConverters.cs
- DatasetMethodGenerator.cs
- PenLineCapValidation.cs
- EntityCommandDefinition.cs
- wgx_render.cs
- X509SecurityTokenProvider.cs
- DataSourceXmlSerializationAttribute.cs
- ValidationVisibilityAttribute.cs
- BridgeDataRecord.cs
- InstanceCompleteException.cs
- Visual3DCollection.cs
- TcpPortSharing.cs
- GenerateHelper.cs
- VideoDrawing.cs
- BrowserCapabilitiesFactory.cs
- RefreshPropertiesAttribute.cs
- NetworkCredential.cs
- FontSourceCollection.cs
- DbConnectionHelper.cs
- TypeSystem.cs
- DataGridViewCellStyle.cs
- WebPartVerb.cs
- WebPartConnectionsConfigureVerb.cs
- TypedTableBaseExtensions.cs
- BamlLocalizer.cs
- ResourcesChangeInfo.cs
- DataReaderContainer.cs
- BindingListCollectionView.cs
- ByteFacetDescriptionElement.cs
- NativeMethods.cs