Пример #1
0
 public NotificationIndicatorViewModel(IServerNotificationsTelemetryManager telemetryManager, IVsBrowserService vsBrowserService)
     : this(telemetryManager, vsBrowserService, ThreadHelper.Generic.Invoke,
            new TimerWrapper {
     AutoReset = false, Interval = 3000                          /* 3 sec */
 })
 {
 }
Пример #2
0
        private NotificationIndicatorViewModel CreateTestSubject(ITimer timer = null,
                                                                 IServerNotificationsTelemetryManager telemetryManager = null,
                                                                 IVsBrowserService vsBrowserService = null)
        {
            timer ??= Mock.Of <ITimer>();
            telemetryManager ??= Mock.Of <IServerNotificationsTelemetryManager>();
            vsBrowserService ??= Mock.Of <IVsBrowserService>();

            return(new NotificationIndicatorViewModel(telemetryManager, vsBrowserService, a => a(), timer));
        }
Пример #3
0
        // For testing
        internal NotificationIndicatorViewModel(IServerNotificationsTelemetryManager telemetryManager,
                                                IVsBrowserService vsBrowserService,
                                                Action <Action> uiThreadInvoker,
                                                ITimer autocloseTimer)
        {
            this.telemetryManager = telemetryManager;
            this.uiThreadInvoker  = uiThreadInvoker;
            this.autocloseTimer   = autocloseTimer;

            NotificationEvents = new ObservableCollection <SonarQubeNotification>();
            text = BuildToolTipText();

            autocloseTimer.Elapsed  += OnAutocloseTimerElapsed;
            ClearUnreadEventsCommand = new RelayCommand(() => HasUnreadEvents = false);

            NavigateToNotification = new DelegateCommand(parameter =>
            {
                var notification = (SonarQubeNotification)parameter;
                vsBrowserService.Navigate(notification.Link.ToString());
                IsToolTipVisible = false;
                telemetryManager.NotificationClicked(notification.Category);
            });
        }