public bool CreateMessageFromByteArray(MessageQueue messageQueue, byte[] body, byte [] header, out string errorMessage, string label = null, bool useDeadLetterQueue = true) {
     try {
         var message = new Message();
         message.Formatter = new BinaryMessageFormatter();
         message.BodyStream.Write(body, 0, body.Length);
         message.Extension = header;
         messageQueue.Execute((queue, transactionType) => queue.Send(message, (label ?? string.Empty), transactionType));
     }
     catch (Exception e) {
         errorMessage = e.Message;
         return false;
     }
     errorMessage = null;
     return true;
 }
 public bool DeleteMessage(MessageQueue messageQueue, string messageId, out string errorMessage)
 {
     try
     {
         messageQueue.Execute((queue, transactionType) => queue.ReceiveById(messageId, transactionType));
     }
     catch (Exception e)
     {
         errorMessage = e.Message;
         return false;
     }
     errorMessage = null;
     return true;
 }
 public bool CreateMessage(MessageQueue messageQueue, object bodyObject, out string errorMessage, string label = null, bool useDeadLetterQueue = true)
 {
     try
     {
         var body = GetXmlBodyObject(bodyObject);
         var message = new Message(body, new XmlMessageFormatter())
                           {
                               UseDeadLetterQueue = useDeadLetterQueue
                           };
         messageQueue.Execute((queue, transactionType) => queue.Send(message, (label ?? string.Empty), transactionType));
     }
     catch (Exception e)
     {
         errorMessage = e.Message;
         return false;
     }
     errorMessage = null;
     return true;
 }