コード例 #1
0
        public static void AddReceiveToFormatterBehavior(Receive receive, OperationDescription operation)
        {
            Fx.Assert(receive != null && operation != null, "Argument cannot be null!");

            KeyedByTypeCollection<IOperationBehavior> behaviors = operation.Behaviors;
            WorkflowFormatterBehavior formatterBehavior = behaviors.Find<WorkflowFormatterBehavior>();
            if (formatterBehavior == null)
            {
                formatterBehavior = new WorkflowFormatterBehavior();
                behaviors.Add(formatterBehavior);
            }

            formatterBehavior.Receives.Add(receive);
        }
 public static void AddReceiveToFormatterBehavior(Receive receive, OperationDescription operation)
 {
     KeyedByTypeCollection<IOperationBehavior> behaviors = operation.Behaviors;
     WorkflowFormatterBehavior item = behaviors.Find<WorkflowFormatterBehavior>();
     if (item == null)
     {
         item = new WorkflowFormatterBehavior();
         behaviors.Add(item);
     }
     item.Receives.Add(receive);
 }