Hi!
How do I get the current user status inside an IAddIn (without using the IceLib-API)?
CIC 4.0 SU3
I have tried to do following:
using ININ.Client.Common.Status;
public class Main : IAddIn
{
INotificationService m_Notification = null;
public void Load(IServiceProvider serviceProvider)
{
// get notification service
m_Notification = (INotificationService)serviceProvider.GetService(typeof(INotificationService));
// get User Status service and register to a change event
IUserStatusService m_UserStatusService = (IUserStatusService)serviceProvider.GetService(typeof(IUserStatusService));
m_UserStatusService.UserStatusChanged += m_UserStatusService_UserStatusChanged;
m_UserStatusService.AddWatch("herm016");
m_UserStatusService.Start();
}
// handle User Status change event
void m_UserStatusService_UserStatusChanged(object sender, UserStatusChangedEventArgs e)
{
m_Notification.Notify("UserStatusChanged: "+e.ToString(), "OK", NotificationType.Info, TimeSpan.FromSeconds(10)); ;
}
[...]
}