Exemplo n.º 1
0
Arquivo: AgentBase.cs Projeto: vkd/VO
 /// <summary>
 /// Receive message method
 /// </summary>
 /// <param name="e">AgentMessageEventArgs</param>
 private void RoutingService_ReceiveMessageEvent(AgentMessageEventArgs e)
 {
     ReceiveMessage(new AgentMessageEventArgs(e.AgentMessage));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Receive message
        /// </summary>
        /// <param name="e">AgentMessaeEventArgs</param>
        void _agent_ReceiveMessage(AgentMessageEventArgs e)
        {
            WriteMessageToLogList(e.AgentMessage);

            if (e.AgentMessage.Text != null && e.AgentMessage.Text.Length > 8)
            {
                if (e.AgentMessage.Text.Substring(0, "Принято [".Length) == "Принято [")
                {
                    AcceptTask(e.AgentMessage);
                    return;
                }
            }

            if (e.AgentMessage.MessageType == MessageType.Message)
            {
                if (MessageBox.Show(
                        _agent.AgentName + ": " + e.AgentMessage.Text,
                        "Принять заказ?",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question)
                    == System.Windows.Forms.DialogResult.Yes)
                {
                    InvokeWriteToLog("Принято: " + e.AgentMessage.Text);
                    _acceptedAgent = e.AgentMessage.Owner;
                    _acceptedTask = e.AgentMessage.Subject;

                    CreateAllOrder();
                    //_agent.AcceptMessage(e.AgentMessage.Owner);
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Receive message method
 /// </summary>
 /// <param name="e">AgentMessaegEventArgs</param>
 private void MessageService_Publish(AgentMessageEventArgs e)
 {
     ReceiveMessage(e.AgentMessage);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Receive message
        /// </summary>
        /// <param name="e">AgentMessaeEventArgs</param>
        void _agent_ReceiveMessage(AgentMessageEventArgs e)
        {
            WriteMessageToLogList(e.AgentMessage);

            if (e.AgentMessage.MessageType == MessageType.Message)
            {
                if (MessageBox.Show(
                        _agent.AgentName + ": " + e.AgentMessage.Text,
                        "Принять задачу?",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question)
                    == System.Windows.Forms.DialogResult.Yes)
                {
                    InvokeWriteToLog("Принято: " + e.AgentMessage.Text);
                    _agent.AcceptMessage(e.AgentMessage.Owner, e.AgentMessage.Subject);
                }
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Receive message
 /// </summary>
 /// <param name="e">AgentMessageEventArgs</param>
 void _agent_ReceiveMessage(AgentMessageEventArgs e)
 {
     WriteMessageToLogList(e.AgentMessage);
 }