Ejemplo n.º 1
0
        private async Task AttachTitleBarButtonAsync()
        {
            var dispatcher = Application.Current.Dispatcher;

            if (dispatcher == null)
            {
                throw new InvalidOperationException("Application.Current.Dispatcher == null");
            }

            while (true)
            {
                var titleBarButton = ServiceLocator.Instance.Resolve <TitleBarButton>();

                var attached = await dispatcher.InvokeAsync(
                    () => VsUi.AttachTitleBarButton(titleBarButton),
                    DispatcherPriority.ApplicationIdle);

                if (attached)
                {
                    break;
                }

                await Task.Delay(1000);
            }
        }
Ejemplo n.º 2
0
 private void OnTimerElapsed(object sender, ElapsedEventArgs e)
 {
     VsUi.BeginInvoke(this.GetAndPublishPredictions);
 }