Esempio n. 1
0
        public Luxa4Slack(IEnumerable <string> slackTokens, bool showUnreadMentions, bool showUnreadMessages, bool showStatus, double brightness, ILuxaforClient luxaforClient, ISlackNotificationAgentFactory slackNotificationAgentFactory)
        {
            _slackTokens = slackTokens ?? throw new ArgumentNullException(nameof(slackTokens));
            if (!_slackTokens.Any())
            {
                throw new ArgumentException("Empty tokens list", nameof(slackTokens));
            }

            _showUnreadMentions            = showUnreadMentions;
            _showUnreadMessages            = showUnreadMessages;
            _showStatus                    = showStatus;
            _brightness                    = brightness;
            _luxaforClient                 = luxaforClient;
            _slackNotificationAgentFactory = slackNotificationAgentFactory;
            _slackAgents                   = new List <ISlackNotificationAgent>();
        }
        public PreferencesViewModel(IWritableOptions <ApplicationOptions> options, ApplicationInfo applicationInfo, IMessenger messenger, ILuxaforClient luxaforClient)
            : base(messenger)
        {
            _options = options;
            Title    = applicationInfo.Format("Preferences");
            Tokens   = new ObservableCollection <SlackToken>();

            UpdatePreferencesCommand = new RelayCommand(() =>
            {
                SaveSettings();
                CloseCommand?.Execute(null);
            });
            CloseCommand        = new RelayCommand(() => Messenger.Send(new CloseWindowMessage()));
            RequestTokenCommand = new RelayCommand(() => Process.Start(new ProcessStartInfo(OAuthHelper.GetAuthorizationUri().ToString())
            {
                UseShellExecute = true
            }));
            RemoveTokenCommand = new RelayCommand <SlackToken>(x => Tokens.Remove(x !));
            AddTokenCommand    = new RelayCommand(() => AddToken());

            _luxaforClient = luxaforClient;

            LoadSettings();
        }
Esempio n. 3
0
        public ApplicationStartup(
            IOptionsMonitor <ApplicationOptions> options,
            TrayIconController trayIconController,
            PreferencesWindowController preferencesWindowController,
            ApplicationInfo applicationInfo,
            Lazy <Dispatcher> dispatcher,
            ILogger <ApplicationStartup> logger,
            ILuxa4SlackFactory luxa4SlackFactory,
            ILuxaforClient luxaforClient,
            IConfigurationRoot configurationRoot)
        {
            _options                     = options;
            _trayIconController          = trayIconController;
            _preferencesWindowController = preferencesWindowController;
            _applicationInfo             = applicationInfo;
            _dispatcher                  = dispatcher;
            _logger            = logger;
            _luxa4SlackFactory = luxa4SlackFactory;
            _luxaforClient     = luxaforClient;
            _configurationRoot = configurationRoot;

            _preferencesWindowController.OpenedChanged += OnPreferencesWindowWindowOpenedChanged;
            _luxaforClient.LuxaforFailed += OnLuxaforFailed;
        }
Esempio n. 4
0
 public Luxa4SlackFactory(ILuxaforClient luxaforClient, ISlackNotificationAgentFactory slackNotificationAgentFactory)
 {
     _luxaforClient = luxaforClient;
     _slackNotificationAgentFactory = slackNotificationAgentFactory;
 }