Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / InitializeCorrelation.cs / 1305376 / InitializeCorrelation.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Activities
{
using System;
using System.Activities;
using System.Collections.Generic;
using System.Runtime.DurableInstancing;
using System.ServiceModel.Activities.Dispatcher;
using SR2 = System.ServiceModel.Activities.SR;
using System.ComponentModel;
using System.Windows.Markup;
using System.Runtime.Collections;
using System.Runtime;
[ContentProperty("CorrelationData")]
public sealed class InitializeCorrelation : NativeActivity
{
public InitializeCorrelation()
{
this.CorrelationData = new OrderedDictionary>();
}
[DefaultValue(null)]
public InArgument Correlation
{
get;
set;
}
public IDictionary> CorrelationData
{
get;
private set;
}
protected override void Execute(NativeActivityContext context)
{
CorrelationHandle correlationHandle = (this.Correlation == null) ? null : this.Correlation.Get(context);
if (correlationHandle == null)
{
//throw only if ambient correlation handle is also null
correlationHandle = context.Properties.Find(CorrelationHandle.StaticExecutionPropertyName) as CorrelationHandle;
if (correlationHandle == null)
{
throw FxTrace.Exception.AsError(
new InvalidOperationException(SR2.NullCorrelationHandleInInitializeCorrelation(this.DisplayName)));
}
}
CorrelationExtension extension = context.GetExtension();
if (extension != null)
{
Dictionary dictionary = new Dictionary();
foreach ( KeyValuePair> pair in this.CorrelationData )
{
Fx.Assert(pair.Value != null, "pair.Value should be validated during cache metadata");
dictionary.Add(pair.Key, pair.Value.Get(context));
}
correlationHandle.InitializeBookmarkScope(context, extension.GenerateKey(dictionary));
}
else
{
throw FxTrace.Exception.AsError(new InvalidOperationException(SR2.InitializeCorrelationRequiresWorkflowServiceHost(this.DisplayName)));
}
}
}
}
// 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
- ContainerControlDesigner.cs
- ResourceCategoryAttribute.cs
- ScrollChrome.cs
- HtmlEmptyTagControlBuilder.cs
- ValueChangedEventManager.cs
- SignedInfo.cs
- AsymmetricKeyExchangeDeformatter.cs
- CodeStatementCollection.cs
- IsolatedStorageFileStream.cs
- DrawListViewSubItemEventArgs.cs
- InputManager.cs
- SqlCacheDependencyDatabase.cs
- HtmlFormAdapter.cs
- Blend.cs
- EqualityComparer.cs
- SendMailErrorEventArgs.cs
- DynamicObject.cs
- XPathNavigatorKeyComparer.cs
- TraceEventCache.cs
- SortQuery.cs
- CheckBoxFlatAdapter.cs
- SemaphoreFullException.cs
- sitestring.cs
- HttpListenerResponse.cs
- InternalDuplexChannelFactory.cs
- WebBrowserEvent.cs
- RegionIterator.cs
- SortAction.cs
- WebPartActionVerb.cs
- ComponentCollection.cs
- X509UI.cs
- ClientSideProviderDescription.cs
- AttributeEmitter.cs
- MissingFieldException.cs
- StringConcat.cs
- NameObjectCollectionBase.cs
- MessageDescription.cs
- OverlappedAsyncResult.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- Rectangle.cs
- ManipulationInertiaStartingEventArgs.cs
- InputMethodStateChangeEventArgs.cs
- SettingsBindableAttribute.cs
- WmlTextBoxAdapter.cs
- filewebresponse.cs
- __FastResourceComparer.cs
- SelectedGridItemChangedEvent.cs
- WmiEventSink.cs
- MbpInfo.cs
- CodeVariableDeclarationStatement.cs
- MetadataItemSerializer.cs
- While.cs
- InputBuffer.cs
- FullTextLine.cs
- PolyLineSegmentFigureLogic.cs
- TemplateControlBuildProvider.cs
- DateTimeOffsetConverter.cs
- ResXResourceReader.cs
- XsltCompileContext.cs
- InlineObject.cs
- XmlSortKey.cs
- _LocalDataStore.cs
- NullableBoolConverter.cs
- SmtpReplyReaderFactory.cs
- Vector3D.cs
- GridItemCollection.cs
- SoapObjectInfo.cs
- DependencyObjectValidator.cs
- CreateUserWizardAutoFormat.cs
- ErrorHandlerModule.cs
- ToolStripSplitStackLayout.cs
- AttachedPropertyDescriptor.cs
- CellNormalizer.cs
- AmbientValueAttribute.cs
- UnmanagedMarshal.cs
- XmlChoiceIdentifierAttribute.cs
- IndependentlyAnimatedPropertyMetadata.cs
- Operators.cs
- JsonEncodingStreamWrapper.cs
- MonthChangedEventArgs.cs
- WebPartCatalogCloseVerb.cs
- SqlCommandSet.cs
- CachedTypeface.cs
- ReachVisualSerializer.cs
- DataQuery.cs
- XmlnsPrefixAttribute.cs
- NetworkInformationPermission.cs
- RegexCode.cs
- StructuralObject.cs
- VerticalAlignConverter.cs
- FileEnumerator.cs
- SettingsProperty.cs
- Int64AnimationBase.cs
- BaseValidator.cs
- HttpWebRequest.cs
- FixedPosition.cs
- TableLayout.cs
- KeyConverter.cs
- TypeContext.cs
- CollectionBuilder.cs