1 //----------------------------------------------------------------------------- 2 // Copyright (c) Microsoft Corporation. All rights reserved. 3 //----------------------------------------------------------------------------- 4 5 namespace System.ServiceModel.Activities 6 { 7 using System.Activities; 8 using System.Collections.Generic; 9 using System.ServiceModel.Description; 10 11 // used in Receive.Content 12 public abstract class ReceiveContent 13 { 14 static ReceiveContent defaultReceiveContent; 15 16 // internal ctor since we control the hierarchy 17 // only supported subclasses are ReceiveMessageContent and ReceiveParametersContent ReceiveContent()18 internal ReceiveContent() 19 { 20 } 21 22 internal static ReceiveContent DefaultReceiveContent 23 { 24 get 25 { 26 if (defaultReceiveContent == null) 27 { 28 defaultReceiveContent = new ReceiveMessageContent(); 29 } 30 return defaultReceiveContent; 31 } 32 } 33 Create(OutArgument message)34 public static ReceiveMessageContent Create(OutArgument message) 35 { 36 return new ReceiveMessageContent(message); 37 } 38 Create(OutArgument message, Type declaredMessageType)39 public static ReceiveMessageContent Create(OutArgument message, Type declaredMessageType) 40 { 41 return new ReceiveMessageContent(message) { DeclaredMessageType = declaredMessageType }; 42 } 43 Create(IDictionary<string, OutArgument> parameters)44 public static ReceiveParametersContent Create(IDictionary<string, OutArgument> parameters) 45 { 46 return new ReceiveParametersContent(parameters); 47 } 48 CacheMetadata(ActivityMetadata metadata, Activity owner, string operationName)49 internal abstract void CacheMetadata(ActivityMetadata metadata, Activity owner, string operationName); 50 ConfigureInternalReceive(InternalReceiveMessage internalReceiveMessage, out FromRequest requestFormatter)51 internal abstract void ConfigureInternalReceive(InternalReceiveMessage internalReceiveMessage, out FromRequest requestFormatter); 52 ConfigureInternalReceiveReply(InternalReceiveMessage internalReceiveMessage, out FromReply responseFormatter)53 internal abstract void ConfigureInternalReceiveReply(InternalReceiveMessage internalReceiveMessage, out FromReply responseFormatter); 54 InferMessageDescription(OperationDescription operation, object owner, MessageDirection direction)55 internal abstract void InferMessageDescription(OperationDescription operation, object owner, MessageDirection direction); 56 ValidateContract(NativeActivityContext context, OperationDescription targetOperation, object owner, MessageDirection direction)57 internal abstract void ValidateContract(NativeActivityContext context, OperationDescription targetOperation, object owner, MessageDirection direction); 58 } 59 } 60