예제 #1
0
        public TwitchService
        (
            string clientId,
            ConfigurationService configurationService,
            ISpeechSynthesizerService speechSynthesizerService,
            ITwitchAPI api       = null,
            ITwitchPubSub pubSub = null,
            ITwitchClient client = null
        )
        {
            if (string.IsNullOrWhiteSpace(clientId))
            {
                throw new ArgumentException(Resources.Argument_cannot_be_null_or_whitespace_, nameof(clientId));
            }

            _configurationService     = configurationService;
            _speechSynthesizerService = speechSynthesizerService;
            _twitchApi    = api ?? new TwitchAPI();
            _twitchPubSub = pubSub ?? new TwitchPubSub();

            _twitchClient = client ?? new TwitchClient();

            ClientId = clientId;
        }
예제 #2
0
        public MainForm
        (
            AuthenticationController authenticationController,
            ITwitchService twitchService,
            ISpeechSynthesizerService windowsSpeechSynthesizerService,
            ConfigurationService configurationService
        )
        {
            _authenticationController = authenticationController;
            _twitchService            = twitchService;
            _speechSynthesizerService = windowsSpeechSynthesizerService;
            _configurationService     = configurationService;

            if (_speechSynthesizerService.GetVoices().Count == 0)
            {
                MessageBox.Show(
                    Resources.MainForm_MainForm_No_voice_packs_available__Please_install_Windows_Speech_Pack_and_retry_,
                    Resources.MainForm_MainForm_Error,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );

                Environment.Exit(1);

                return;
            }

            InitializeComponent();

            BindEventHandlers();

            authenticationController.CheckAuthentication();

            FillVoices();
            InitializeTimers();
        }