Example #1
0
 void SetupReceiveContextEnabledAttribute(ServiceEndpoint serviceEndpoint)
 {
     if (BufferedReceiveServiceBehavior.IsWorkflowEndpoint(serviceEndpoint))
     {
         foreach (OperationDescription operation in serviceEndpoint.Contract.Operations)
         {
             ReceiveContextEnabledAttribute behavior = operation.Behaviors.Find <ReceiveContextEnabledAttribute>();
             if (behavior == null)
             {
                 operation.Behaviors.Add(new ReceiveContextEnabledAttribute()
                 {
                     ManualControl = true
                 });
             }
             else
             {
                 behavior.ManualControl = true;
             }
         }
     }
 }
Example #2
0
 private void SetupReceiveContextEnabledAttribute(ServiceEndpoint serviceEndpoint)
 {
     if (BufferedReceiveServiceBehavior.IsWorkflowEndpoint(serviceEndpoint))
     {
         foreach (OperationDescription description in serviceEndpoint.Contract.Operations)
         {
             ReceiveContextEnabledAttribute attribute = description.Behaviors.Find <ReceiveContextEnabledAttribute>();
             if (attribute == null)
             {
                 ReceiveContextEnabledAttribute item = new ReceiveContextEnabledAttribute {
                     ManualControl = true
                 };
                 description.Behaviors.Add(item);
             }
             else
             {
                 attribute.ManualControl = true;
             }
         }
     }
 }