Esempio n. 1
0
        public static void RemoveReceiveFromFormatterBehavior(Receive receive, OperationDescription operation)
        {
            Fx.Assert(receive != null && operation != null, "Arguments cannot be null!");

            KeyedByTypeCollection <IOperationBehavior> behaviors = operation.Behaviors;
            WorkflowFormatterBehavior formatterBehavior          = behaviors.Find <WorkflowFormatterBehavior>();

            if (formatterBehavior != null)
            {
                formatterBehavior.Receives.Remove(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);
        }
Esempio n. 3
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);
        }