コード例 #1
0
ファイル: AddIn.cs プロジェクト: gildas/Plantronics
        public void Load(IServiceProvider serviceProvider)
        {
            try
            {
                s_traceContext = (ITraceContext)serviceProvider.GetService(typeof(ITraceContext));

                //must have the icelib sdk license to get the session as a service
                s_session = (Session)serviceProvider.GetService(typeof(Session));
                s_connection = new Connection.Connection(s_session);
            }
            catch (ArgumentNullException)
            {
                s_traceContext.Error("unable to get Icelib Session, is the ICELIB SDK License available?");
                Debug.Fail("unable to get service.  Is the ICELIB SDK licence available?");
                throw;
            }

            s_interactionManager = new InteractionManager(s_session, (IQueueService)serviceProvider.GetService(typeof(IQueueService)), s_traceContext);
            s_statusManager = new CicStatusService(s_session, s_traceContext);
            s_notificationService = (INotificationService)serviceProvider.GetService(typeof(INotificationService));

            s_settingsManager = new SettingsManager();
            s_deviceManager = new DeviceManager(s_traceContext, new SpokesDebugLogger(s_traceContext));

            s_statusChanger = new StatusChanger(s_session, s_statusManager, s_deviceManager, s_settingsManager);
            s_notificationServer = new NotificationServer(s_deviceManager, s_settingsManager, s_notificationService);

            s_hookSwitchManager = new InteractionSyncManager(s_interactionManager, s_deviceManager, (IQueueService)serviceProvider.GetService(typeof(IQueueService)), s_traceContext, s_connection);

            s_outboundEventNotificationService = new OutboundEventNotificationService(s_session, s_statusManager, s_deviceManager, s_traceContext);

            s_traceContext.Always("Plantronics AddIn Loaded");
        }
コード例 #2
0
ファイル: StatusChanger.cs プロジェクト: gildas/Plantronics
        public StatusChanger(Session icSession, ICicStatusService cicStatusService, IDeviceManager deviceManager, ISettingsManager settingsManager )
        {
            _settingsManager = settingsManager;
            _deviceManager = deviceManager;
            _cicStatusService = cicStatusService;
            _icSession = icSession;

            _deviceManager.PlantronicsDeviceAttached += OnPlantronicsDeviceAttached;
            _deviceManager.HeadsetConnected += OnHeadsetConnected;
            _deviceManager.PlantronicsDeviceDetached += OnPlantronicsDeviceDetached;
            _deviceManager.HeadsetDisconnected += OnHeadsetDisconnected;
        }
コード例 #3
0
        public OutboundEventNotificationService(Session session, ICicStatusService statusService, IDeviceManager deviceManager, ITraceContext traceContext)
        {
            _deviceManager = deviceManager;
            _session = session;
            _traceContext = traceContext;
            _statusService = statusService;
            _statusService.UserStatusChanged += OnUserStatusChanged;

            _session.ConnectionStateChanged += OnConnectionStateChanged;

            _deviceManager.HeadsetConnected += OnDeviceEvent;
            _deviceManager.HeadsetDisconnected += OnDeviceEvent;
            _deviceManager.MuteChanged += OnDeviceEvent;
            _deviceManager.PlantronicsDeviceAttached += OnDeviceEvent;
            _deviceManager.PlantronicsDeviceDetached += OnDeviceEvent;

            _serverParams = new ServerParameters(_session);
            _serverParams.StartWatching(new []{ShouldSendHandlerNotificationParam, WebServerUrlParam});

            PostToWebService();
        }