Ejemplo n.º 1
0
            public void Tick()
            {
                if (_dlg == null)
                {
                    if (_start > DateTime.UtcNow)
                    {
                        return;
                    }

                    IVsThreadedWaitDialog dlg = _context.GetService <IVsThreadedWaitDialog>(typeof(SVsThreadedWaitDialog));

                    if (dlg != null)
                    {
                        if (VSErr.Succeeded(dlg.StartWaitDialog(_caption, _message, null, (uint)__VSTWDFLAGS.VSTWDFLAGS_TOPMOST, null, null)))
                        {
                            _dlg = dlg;
                        }
                    }
                }
                else
                {
                    int canceled;
                    _dlg.GiveTimeSlice(null, null, 0, out canceled);
                }
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaitDialog"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="text">The text.</param>
 public WaitDialog(IServiceProvider serviceProvider, string caption, string text)
 {
     _service = serviceProvider.GetService(typeof(SVsThreadedWaitDialog)) as IVsThreadedWaitDialog;
     if (_service != null)
     {
         _service.StartWaitDialog(caption, text, null, 0, null, null);
     }
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     if (_dlg != null)
     {
         try
         {
             int canceled = 0;
             _dlg.EndWaitDialog(ref canceled);
         }
         finally
         {
             _dlg = null;
         }
     }
 }
Ejemplo n.º 4
0
            public void Dispose()
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                if (_dlg != null)
                {
                    try
                    {
                        int canceled = 0;
                        _dlg.EndWaitDialog(ref canceled);
                    }
                    finally
                    {
                        _dlg = null;
                    }
                }
            }