/// <summary> /// Receive message method /// </summary> /// <param name="e">AgentMessageEventArgs</param> private void RoutingService_ReceiveMessageEvent(AgentMessageEventArgs e) { ReceiveMessage(new AgentMessageEventArgs(e.AgentMessage)); }
/// <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); } } }
/// <summary> /// Receive message method /// </summary> /// <param name="e">AgentMessaegEventArgs</param> private void MessageService_Publish(AgentMessageEventArgs e) { ReceiveMessage(e.AgentMessage); }
/// <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); } } }
/// <summary> /// Receive message /// </summary> /// <param name="e">AgentMessageEventArgs</param> void _agent_ReceiveMessage(AgentMessageEventArgs e) { WriteMessageToLogList(e.AgentMessage); }