public PlantronicsManager(IStatusManager statusManager, 
            IInteractionManager interactionManager,
            INotificationService notificationService,
            ITraceContext traceContext)
        {
            _statusManager = statusManager;
            _interactionManager = interactionManager;
            _traceContext = traceContext;
            _notificationService = notificationService;

            m_sessionComManager = new SessionComManagerClass();
            m_sessionManagerEvents = m_sessionComManager as ISessionCOMManagerEvents_Event;
            m_comSession = m_sessionComManager.Register("Interaction Client Plantronics AddIn");

            // Now check if our plugin session was created
            if (m_comSession != null)
            {
                // detect devices added/removed
                m_sessionManagerEvents.DeviceStateChanged += OnDeviceStateChanged;

                //Get current Device
                m_device = m_comSession.ActiveDevice;

                // if we have a device register for events
                if (m_device != null)
                {
                    // Register for device events
                    RegisterEvents();
                }
            }
        }
Exemple #2
0
        public JabraModule(IUnityContainer container,
                           IViewManager viewManager,
                           IViewEventManager viewEventManager,
                           ICommandManager commandManager,
                           IConfigManager configManager,
                           IInteractionManager interactionManager,
                           IEventAggregator eventAggregator,
                           IAgent agent,
                           ILogger log)
        {
            this.container          = container;
            this.viewManager        = viewManager;
            this.viewEventManager   = viewEventManager;
            this.commandManager     = commandManager;
            this.configManager      = configManager;
            this.interactionManager = interactionManager;
            this.eventAggregator    = eventAggregator;
            this.agent = agent;

            this.log = log.CreateChildLogger(moduleName);
            if (log.IsDebugEnabled)
            {
                this.log.Debug("Constructor");
            }
        }
Exemple #3
0
        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");
        }
 /// <summary>
 /// Creates the singleton instance.
 /// </summary>
 /// <param name="theConfigManager">The config manager.</param>
 public static void CreateInstance(IUnityContainer container,
                                   ICommandManager commandManager,
                                   IInteractionManager interactionManager,
                                   IAgent agent,
                                   ILogger log)
 {
     Default = new JabraUtils(container, commandManager, interactionManager, agent, log);
 }
Exemple #5
0
        //private IConfService confService;


        /// <summary>
        /// Initializes a new instance of the <see cref="ExtensionSampleModule"/> class.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="viewManager">The view manager.</param>
        /// <param name="commandManager">The command manager.</param>
        public ExtensionSampleModule(IObjectContainer container, IViewManager viewManager, IInteractionManager interactionManager, ICommandManager commandManager, IViewEventManager viewEventManager)
        {
            this.container          = container;
            this.viewManager        = viewManager;
            this.commandManager     = commandManager;
            this.viewEventManager   = viewEventManager;
            this.interactionManager = interactionManager;
        }
Exemple #6
0
 public BeeBehaviorResolver(IBeeCommon beeCommon, IFlowerManager flowerManager, ILandscapeManager landscapeManager, IInteractionManager interactionManager, IMovementBehaviorCommandInvoker movementBehaviorCommandInvoker, IMovementSelector movementSelector)
 {
     _beeCommon                      = beeCommon;
     _flowerManager                  = flowerManager;
     _landscapeManager               = landscapeManager;
     _interactionManager             = interactionManager;
     _movementBehaviorCommandInvoker = movementBehaviorCommandInvoker;
     _movementSelector               = movementSelector;
 }
 public InteractionExtensionCrossnetModule(IObjectContainer container, IViewManager viewManager, IInteractionManager interactionManager, ICommandManager commandManager, IViewEventManager viewEventManager, ICase caseIdentifier)
 {
     _container          = container;
     _viewManager        = viewManager;
     _interactionManager = interactionManager;
     _viewEventManager   = viewEventManager;
     _metodos            = new LogicaNegocio();
     _commandManager     = commandManager;
     _caseIdentifier     = caseIdentifier;
 }
Exemple #8
0
 public WorldMediator(
     IBeeCommon beeCommon,
     IBeeManager beeManager,
     IFlowerManager flowerManager,
     ILandscapeManager landscapeManager,
     IInteractionManager interactionManager)
 {
     _beeCommon          = beeCommon;
     _beeManager         = beeManager;
     _flowerManager      = flowerManager;
     _landscapeManager   = landscapeManager;
     _interactionManager = interactionManager;
 }
Exemple #9
0
        public MainForm()
        {
            InitializeComponent();

            this.Text = "Trains - " + ThisAssembly.AssemblyInformationalVersion;

            _game = DI.ServiceLocator.GetService <IGame>();
            _interactionManager = DI.ServiceLocator.GetService <IInteractionManager>();

            _game.SetSize(_skControl.Width, _skControl.Height);

            _skControl.SizeChanged += (s, e) => _game.SetSize(_skControl.Width, _skControl.Height);
            _skControl.MouseDown   += SKControl_MouseDown;
            _skControl.MouseMove   += SKControl_MouseMove;
            _skControl.MouseUp     += SKControl_MouseUp;
            _skControl.MouseWheel  += SKControl_MouseWheel;

            _ = PresentLoop();
        }
Exemple #10
0
        public void Load(IServiceProvider serviceProvider)
        {
            try
            {
                _traceContext = (ITraceContext)serviceProvider.GetService(typeof(ITraceContext));

                //must have the icelib sdk license to get the session as a service
                _session = (Session)serviceProvider.GetService(typeof(Session));
                _interactionManager = new InteractionManager(_session, (IQueueService)serviceProvider.GetService(typeof(IQueueService)), _traceContext);
                _statusManager = new StatusManager(_session);
                _notificationService = (INotificationService)serviceProvider.GetService(typeof(INotificationService));

                _plantronicsManager = new PlantronicsManager(_statusManager, _interactionManager, _notificationService, _traceContext);
                _traceContext.Always("Plantronics AddIn Loaded");
            }
            catch (ArgumentNullException)
            {
                Debug.Fail("unable to get service.  Is the ICELIB SDK licence available?");
                throw;
            }
        }
        public JabraUtils(IUnityContainer container,
                          ICommandManager commandManager,
                          IInteractionManager interactionManager,
                          IAgent agent,
                          ILogger log)
        {
            this.container      = container;
            this.commandManager = commandManager;
            // ICommandManager could also be retrieved/resolved via the container
            // this.commandManager = container.Resolve<ICommandManager>();
            this.interactionManager = interactionManager;
            // IInteractionManager could also be retrieved/resolved via the container
            // this.interactionManager = container.Resolve<IInteractionManager>();
            this.agent = agent;
            // IAgent could also be retrieved/resolved via the container
            // this.agent = container.Resolve<IAgent>();

            this.log = log;

            InitJabraLibrary();
        }
        public InteractionSyncManager(IInteractionManager interactionManager, IDeviceManager deviceManager, IQueueService queueService, ITraceContext traceContext, IConnection connection)
        {
            _interactionManager = interactionManager;
            _deviceManager = deviceManager;
            _traceContext = traceContext;

            _connection = connection;
            _connection.UpChanged += OnConnectionUpChanged;

            _deviceManager.CallAnsweredByDevice += OnCallAnsweredByDevice;
            _deviceManager.CallEndedByDevice += OnCallEndedByDevice;
            _deviceManager.MuteChanged += OnMuteChangedByDevice;
            _deviceManager.OnCall += OnOnCall;
            //    _deviceManager.TalkButtonPressed += OnTalkButtonPressed;
            _deviceManager.TalkButtonHeld += OnTalkButtonHeld;

            _myInteractions = queueService.GetMyInteractions(new[] { InteractionAttributes.State, InteractionAttributes.Muted });
            _myInteractions.InteractionAdded += OnInteractionAdded;
            _myInteractions.InteractionChanged += OnInteractionChanged;
            _myInteractions.InteractionRemoved += OnInteractionRemoved;
        }
Exemple #13
0
 public BeeManager(
     IBeeCommon beeCommon,
     IBeeBehaviorResolver beeBehaviorResolver,
     IBeeWingsMovementInvoker beeWingsMovementInvoker,
     IImageDrawing imageDrawing,
     IMovementBehaviorCommandInvoker movementBehaviorCommandInvoker,
     ILifeFactory lifeFactory,
     IInteractionManager interactionManager,
     ILinearMovementStrategy linearMovementStrategy,
     IMovementSelector movementSelector,
     ICommonUtilities utilitiesResolver
     )
 {
     _beeCommon                      = beeCommon;
     _beeBehaviorResolver            = beeBehaviorResolver;
     _beeWingsMovementInvoker        = beeWingsMovementInvoker;
     _movementBehaviorCommandInvoker = movementBehaviorCommandInvoker;
     _imageDrawing                   = imageDrawing;
     _lifeFactory                    = lifeFactory;
     _interactionManager             = interactionManager;
     _linearMovementStrategy         = linearMovementStrategy;
     _movementSelector               = movementSelector;
     _utilitiesResolver              = utilitiesResolver;
 }
Exemple #14
0
        public MainWindow()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            InitializeComponent();

            if (File.Exists(_windowSizeFileName))
            {
                string   sizeString = File.ReadAllText(_windowSizeFileName);
                string[] bits       = sizeString.Split(',');
                if (bits.Length == 2)
                {
                    if (double.TryParse(bits[0], out double width) && double.TryParse(bits[1], out double height))
                    {
                        this.Width  = width;
                        this.Height = height;
                    }
                }
            }

            _game = DI.ServiceLocator.GetService <IGame>();
            _interactionManager = DI.ServiceLocator.GetService <IInteractionManager>();

            _gameElement = new GameElement(_game);

            _gameElement.MouseDown  += SKElement_MouseDown;
            _gameElement.MouseMove  += SKElement_MouseMove;
            _gameElement.MouseUp    += SKElement_MouseUp;
            _gameElement.MouseWheel += SKElement_MouseWheel;

            this.Content = _gameElement;

            this.Title = "Trains - " + ThisAssembly.AssemblyInformationalVersion;

            _gameElement.SizeChanged += SKElement_SizeChanged;
        }
Exemple #15
0
 public InteractionController(IInteractionManager interactionService)
 {
     _interactionService = interactionService;
 }
 public CommandManager(IInteractionManager interactionManager)
 {
     this.InteractionManager = interactionManager;
 }
Exemple #17
0
 public GameManager(IInteractionManager interactionManager, ILocationManager locationManager, IPlayerManager playerManager)
 {
     _interactionManager = interactionManager;
     _locationManager    = locationManager;
     _playerManager      = playerManager;
 }
 public TrainsDelegate(IGame game, IInteractionManager interactionManager)
 {
     _game = game;
     _interactionManager = interactionManager;
 }
Exemple #19
0
 public CommandManager(IInteractionManager interactionManager)
 {
     this.InteractionManager = interactionManager;
 }
Exemple #20
0
        public MainPage(IGame game,
                        IEnumerable <ITool> tools,
                        IEnumerable <ILayerRenderer> layers,
                        IEnumerable <ICommand> commands,
                        ITrainController trainControls,
                        ILayout trackLayout,
                        IGameStorage gameStorage,
                        ITerrainMap terrainMap,
                        TrainsDelegate trainsDelegate,
                        IInteractionManager interactionManager)
        {
            this.Title("Trains - " + ThisAssembly.AssemblyInformationalVersion);

            _game               = game;
            _controlDelegate    = trainsDelegate;
            _interactionManager = interactionManager;
            this.Body           = () =>
            {
                return(new HStack()
                {
                    new VStack()
                    {
                        _configurationShown?null:
                        new Button(trainControls.BuildMode ? "Building" : "Playing", () => SwitchGameMode()),
                        new Spacer(),
                        _configurationShown ?
                        CreateConfigurationControls(layers) :
                        CreateToolsControls(tools, trainControls.BuildMode.Value),
                        new Spacer(),
                        _configurationShown || !trainControls.BuildMode ? null :
                        CreateCommandControls(commands),
                        new Spacer(),
                        new HStack()
                        {
                            new Button(" - ", () => _game.ZoomOut())
                            .Frame(40),
                            new Spacer(),
                            new Button(" + ", () => _game.ZoomIn())
                            .Frame(40),
                        },
                        new Spacer(),
                        new Button("Snapshot", () => Snapshot()),
                        new Button("Configuration", () => _configurationShown.Value = !_configurationShown.Value)
                    }.Frame(100, alignment: Alignment.Top),
                    new VStack()
                    {
                        new TrainControllerPanel(trainControls),
                        new DrawableControl(_controlDelegate)
                    }
                }.FillHorizontal());
            };

            _trackLayout = trackLayout;
            _gameStorage = gameStorage;

            _ = PresentLoop();

            void SwitchGameMode()
            {
                trainControls.ToggleBuildMode();

                if (_interactionManager == null)
                {
                    return;
                }

                _interactionManager.CurrentTool = tools.FirstOrDefault(t => ShouldShowTool(trainControls.BuildMode, t));
            }

            void Snapshot()
            {
                (int width, int height) = _game.GetSize();
                using var bitmap        = new SKBitmap(width, height, SKImageInfo.PlatformColorType, SKAlphaType.Premul);
                using var skCanvas      = new SKCanvas(bitmap);
                using (ICanvas canvas = new SKCanvasWrapper(skCanvas))
                {
                    canvas.Save();
                    _game.Render(canvas);
                    canvas.Restore();
                }
                Clipboard.SetImage(bitmap.ToWriteableBitmap());
            }

            _terrainMap = terrainMap;
        }