Hello!
I have a little problem, I try to get the ChatChannel to be used to send a message from the agent to the customer with BasicChatProtocol, within the WDE, with this code:
[code]using Genesyslab.Desktop.Infrastructure.Commands;
using Genesyslab.Desktop.Infrastructure.DependencyInjection;
using Genesyslab.Desktop.Infrastructure.ViewManager;
using Genesyslab.Desktop.Infrastructure;
using Genesyslab.Desktop.Modules.Windows.Event;
using System.Windows;
using Genesyslab.Desktop.Modules.Core.Model.Interactions;
using System;
using System.Diagnostics;
using System.Net;
using Genesyslab.Desktop.Modules.OpenMedia.Model.Interactions.Chat;
using Genesyslab.Platform.Commons.Logging;
using Genesyslab.Platform.WebMedia.Protocols.BasicChat.Events;
using Genesyslab.Platform.WebMedia.Protocols.BasicChat;
using Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests;
using Genesyslab.Platform.WebMedia.Protocols;
namespace Genesyslab.Desktop.Modules.Module_Chat
{
/// <summary>
/// Questa classe è il modulo per la customizzazione degli eventi chat
/// </summary>
public class ModuleChat : IModule
{
readonly IObjectContainer container;
readonly ICommandManager commandManager;
readonly IViewEventManager viewEventManager;
ILogger log;
string sessionID = "null";
string userID = null;
/// <summary>
/// Inizializza una nuovs istanza di <see cref="Module"/> class.
/// </summary>
/// <param name="container">The container.</param>
/// <param name="commandManager">The command manager.</param>
public ExtensionModuleChat(IObjectContainer container, IViewManager viewManager, ICommandManager commandManager, IViewEventManager viewEventManager)
{
this.container = container;
this.commandManager = commandManager;
this.viewEventManager = viewEventManager;
// Initialize the trace system
this.log = container.Resolve<ILogger>();
// Create a child trace section
this.log = log.CreateChildLogger("Module ---> constructor");
}
/// <summary>
/// Inizializza il modulo.
/// </summary>
public void Initialize()
{
var interactionManager = container.Resolve<IInteractionManager>();
if (interactionManager != null)
{
//receive interactione events
interactionManager.InteractionEvent += new EventHandler<EventArgs<Core.Model.Interactions.IInteraction>>(EventHandler_InteractionEvent);
}
}
}
private void EventHandler_InteractionEvent(object sender, EventArgs<Core.Model.Interactions.IInteraction> e)
{
try
{
IInteraction interaction = e.Value;
if (interaction != null)
{
if (interaction is IInteractionChat)
{
IInteractionChat interactionChat = (IInteractionChat)interaction;
Genesyslab.Enterprise.Model.Interaction.IInteraction enterpriseInteraction = interactionChat.EntrepriseInteractionCurrent;
Genesyslab.Enterprise.Model.Channel.IClientChannel channel = enterpriseInteraction.ActiveChannel;
........
// with channel I try to take de protocol for send a message in a chat....
}
}
}
catch (Exception ex)
{
.....
}
}
}
}[/code]
When this code goes in execution, the Message Box that I've set for debug not be showed and the flow goes wrong without exception, how if the module is not being loaded.
Can you help me to understand where i was wrong?
Thanks for the advices