public VisualStudioWaitContext(IVsThreadedWaitDialogFactory dialogFactory,
                                string title,
                                string message,
                                bool allowCancel) {
     _title                   = title;
     _message                 = message;
     _allowCancel             = allowCancel;
     _cancellationTokenSource = new CancellationTokenSource();
     _dialog                  = CreateDialog(dialogFactory);
 }
        private void StopProgressBar()
        {
            if (attachingDialog == null)
            {
                return;
            }

            int canceled;

            attachingDialog.EndWaitDialog(out canceled);
            attachingDialog = null;
        }
예제 #3
0
        public VisualStudioWaitContext(IVsThreadedWaitDialogFactory dialogFactory,
                                       string title,
                                       string message,
                                       bool allowCancel)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            _title                   = title;
            _message                 = message;
            _allowCancel             = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();
            _dialog                  = CreateDialog(dialogFactory);
        }
        public VisualStudioWaitContext(IVsThreadedWaitDialogFactory waitDialogFactory, string title, string message, bool allowCancel, int totalSteps = 0)
        {
            _title      = title;
            _message    = message;
            _totalSteps = totalSteps;

            if (allowCancel)
            {
                _cancellationTokenSource = new CancellationTokenSource();
            }

            _dialog = CreateDialog(waitDialogFactory);
        }
예제 #5
0
        private void StopProgressBar()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (attachingDialog == null)
            {
                return;
            }

            int canceled;

            attachingDialog.EndWaitDialog(out canceled);
            attachingDialog = null;
        }
        public VisualStudioWaitContext(
            IGlobalOperationNotificationService notificationService,
            IVsThreadedWaitDialogFactory dialogFactory,
            string title,
            string message,
            bool allowCancel)
        {
            _title = title;
            _message = message;
            _allowCancel = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();

            _dialog = CreateDialog(dialogFactory);
            _registration = notificationService.Start(title);
        }
예제 #7
0
        public VisualStudioWaitContext(
            IGlobalOperationNotificationService notificationService,
            IVsThreadedWaitDialogFactory dialogFactory,
            string title,
            string message,
            bool allowCancel)
        {
            _title                   = title;
            _message                 = message;
            _allowCancel             = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();

            _dialog       = CreateDialog(dialogFactory);
            _registration = notificationService.Start(title);
        }
        private void StartProgressBar(string title, string message, string progressMessage)
        {
            var dialogFactory             = GetService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;
            IVsThreadedWaitDialog2 dialog = null;

            if (dialogFactory != null)
            {
                dialogFactory.CreateInstance(out dialog);
            }

            attachingDialog = (IVsThreadedWaitDialog3)dialog;

            attachingDialog.StartWaitDialogWithCallback(title,
                                                        message, string.Empty, null,
                                                        progressMessage, true, 0,
                                                        true, 0, 0, this);
        }
        public VisualStudioWaitContext(
            IVsThreadedWaitDialogFactory dialogFactory,
            string title,
            string message,
            bool allowCancel,
            bool showProgress)
        {
            _title                   = title;
            _message                 = message;
            _allowCancel             = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();

            this.ProgressTracker = showProgress
                ? new ProgressTracker((_1, _2) => UpdateDialog())
                : new ProgressTracker();

            _dialog = CreateDialog(dialogFactory, showProgress);
        }
예제 #10
0
        public VisualStudioWaitContext(
            IGlobalOperationNotificationService notificationService,
            IVsThreadedWaitDialogFactory dialogFactory,
            string title,
            string message,
            bool allowCancel, 
            bool showProgress)
        {
            _title = title;
            _message = message;
            _allowCancel = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();

            this.ProgressTracker = showProgress
                ? new ProgressTracker((_1, _2) => UpdateDialog())
                : new ProgressTracker();

            _dialog = CreateDialog(dialogFactory, showProgress);
            _registration = notificationService.Start(title);
        }
예제 #11
0
        public VisualStudioWaitContext(
            IGlobalOperationNotificationService notificationService,
            IVsThreadedWaitDialogFactory dialogFactory,
            string title,
            string message,
            bool allowCancel,
            bool showProgress)
        {
            _title                   = title;
            _message                 = message;
            _allowCancel             = allowCancel;
            _cancellationTokenSource = new CancellationTokenSource();

            this.ProgressTracker = showProgress
                ? new ProgressTracker((_1, _2, _3) => UpdateDialog())
                : new ProgressTracker();

            _dialog       = CreateDialog(dialogFactory, showProgress);
            _registration = notificationService.Start(title);
        }
예제 #12
0
        private async Task StartProgressBarAsync(string title, string message, string progressMessage)
        {
            await package.JoinableTaskFactory.SwitchToMainThreadAsync();

            var dialogFactory = await this.ServiceProvider.GetServiceAsync(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;

            IVsThreadedWaitDialog2 dialog = null;

            if (dialogFactory != null)
            {
                dialogFactory.CreateInstance(out dialog);
            }

            attachingDialog = (IVsThreadedWaitDialog3)dialog;

            attachingDialog.StartWaitDialogWithCallback(title,
                                                        message, string.Empty, null,
                                                        progressMessage, true, 0,
                                                        true, 0, 0, this);
        }
        private void StopProgressBar()
        {
            if (attachingDialog == null)
                return;

            int canceled;
            attachingDialog.EndWaitDialog(out canceled);
            attachingDialog = null;
        }
        private void StartProgressBar(string title, string message, string progressMessage)
        {
            var dialogFactory = GetService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;
            IVsThreadedWaitDialog2 dialog = null;
            if (dialogFactory != null)
            {
                dialogFactory.CreateInstance(out dialog);
            }

            attachingDialog = (IVsThreadedWaitDialog3)dialog;

            attachingDialog.StartWaitDialogWithCallback(title,
                message, string.Empty, null,
                progressMessage, true, 0,
                true, 0, 0, this);
        }