Пример #1
0
        void CreateProgressDialog()
        {
            var dialogFactory = GetService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;
            IVsThreadedWaitDialog2 progressDialog = null;

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

            if (progressDialog != null &&
                progressDialog.StartWaitDialog(
                    ResolveUR.Library.Constants.AppName + " Working...",
                    "Visual Studio is busy. Cancel ResolveUR by clicking Cancel button",
                    string.Empty,
                    null,
                    string.Empty,
                    0,
                    true,
                    true) == VSConstants.S_OK)
            {
                Thread.Sleep(1000);
            }

            _helper.ProgressDialog = progressDialog;

            var dialogCanceled = false;

            if (progressDialog != null)
            {
                progressDialog.HasCanceled(out dialogCanceled);
            }

            if (!dialogCanceled)
            {
                return;
            }

            _resolveur.Cancel();
            _helper.ShowMessageBox(ResolveUR.Library.Constants.AppName + " Status", "Canceled");
        }