Пример #1
0
        private async Task InitializeAsync()
        {
            _logger.LogInformation("Initializing");

            _luxa4Slack?.Dispose();

            if (_options.CurrentValue.Tokens.Length == 0)
            {
                _dispatcher.Value.Invoke(() => _preferencesWindowController.ShowDialog());
            }
            else
            {
                _luxa4Slack = _luxa4SlackFactory.Create(
                    _options.CurrentValue.Tokens,
                    _options.CurrentValue.ShowUnreadMentions,
                    _options.CurrentValue.ShowUnreadMessages,
                    _options.CurrentValue.ShowStatus,
                    _options.CurrentValue.Brightness);

                try
                {
                    await _luxa4Slack.InitializeAsync();
                }
                catch (Exception ex)
                {
                    ShowError($"Unable to initialize Luxa4Slack: {ex.Message}", ex);
                }
            }
        }
Пример #2
0
 public TrayIconViewModel(PreferencesWindowController preferencesWindowController, ApplicationInfo applicationInfo)
 {
     ShowPreferencesCommand = new RelayCommand(() => preferencesWindowController.ShowDialog());
     ExitApplicationCommand = new RelayCommand(() => Application.Current.Shutdown());
     _lazyIcon = new Lazy <ImageSource>(() => new BitmapImage(new Uri("pack://application:,,,/Luxa4Slack.Tray;component/Icon.ico")));
     ToolTip   = applicationInfo.DisplayName;
 }