Пример #1
0
        private void OrderReceived(object sender, System.Messaging.ReceiveCompletedEventArgs e)
        {
            System.Messaging.XmlMessageFormatter formatter = new System.Messaging.XmlMessageFormatter(new Type[] { typeof(WorkOrder) });
            System.Messaging.Message             msg       = messageQueueVehiclesToAssemble.EndReceive(e.AsyncResult);
            msg.Formatter = formatter;

            WorkOrder workOrder = msg.Body as WorkOrder;

            // start waiting for the next message
            messageQueueVehiclesToAssemble.BeginReceive();

            FireMessage(workOrder);
        }