Exemplo n.º 1
0
        private ConnectionManager(StreamDeckToolkitOptions options, ILoggerFactory loggerFactory = null, IStreamDeckProxy streamDeckProxy = null) : this()
        {
            var myInfo = JsonConvert.DeserializeObject <Info>(options.Info);

            Info           = myInfo;
            _port          = options.Port;
            _uuid          = options.PluginUUID;
            _registerEvent = options.RegisterEvent;
            _proxy         = streamDeckProxy ?? new StreamDeckProxy();

            _LoggerFactory = loggerFactory ?? NullLoggerFactory.Instance;
            _logger        = loggerFactory?.CreateLogger <ConnectionManager>();
        }
        //CHANGED
        private ConnectionManager(StreamDeckToolkitOptions options, ILoggerFactory loggerFactory = null, IActionController actionController = null, IStreamDeckProxy streamDeckProxy = null) : this()
        {
            if (actionController == null)
            {
                throw new ArgumentNullException("actionManager", "ActionManager cannot be null, these should be retrieved from commandline args."); //CHANGED
            }
            _ActionController             = actionController;                                                                                       //CHANGED
            _ActionController.DeckManager = this;

            var myInfo = JsonConvert.DeserializeObject <Info>(options.Info);

            Info           = myInfo;
            _port          = options.Port;
            _uuid          = options.PluginUUID;
            _registerEvent = options.RegisterEvent;
            _proxy         = streamDeckProxy ?? new StreamDeckProxy();

            _LoggerFactory = loggerFactory ?? NullLoggerFactory.Instance;
            _logger        = loggerFactory?.CreateLogger <ConnectionManager>();
        }