public void HandleButton(object sender, EventArgs e)
    {
      var solutionUpdateViewModel = new SolutionUpdateViewModel();
      var addLicenseHeaderToAllProjectsCommand = new AddLicenseHeaderToAllProjectsCommand (_licenseReplacer, _defaultLicenseHeaderPage, solutionUpdateViewModel);
      var buttonThreadWorker = new SolutionLevelButtonThreadWorker(addLicenseHeaderToAllProjectsCommand);
      var dialog = new SolutionUpdateDialog(solutionUpdateViewModel);


      dialog.Closing += DialogOnClosing;
      _resharperSuspended = CommandUtility.ExecuteCommandIfExists("ReSharper_Suspend", _dte2);
      Dispatcher uiDispatcher = Dispatcher.CurrentDispatcher;

      buttonThreadWorker.ThreadDone += (o, args) =>
      {
        uiDispatcher.BeginInvoke(new Action(() => { dialog.Close(); }));
        ResumeResharper();
      };

      _solutionUpdateThread = new System.Threading.Thread(buttonThreadWorker.Run)
      {
        IsBackground = true
      };
      _solutionUpdateThread.Start(_dte2.Solution);

      dialog.ShowModal(); 
    }
 public SolutionUpdateDialog (SolutionUpdateViewModel solutionUpdateViewModel)
 {
   InitializeComponent ();
   this.DataContext = solutionUpdateViewModel;
 }
 public AddLicenseHeaderToAllProjectsCommand(LicenseHeaderReplacer licenseReplacer, IDefaultLicenseHeaderPage licenseHeaderPage, SolutionUpdateViewModel solutionUpdateViewModel)
 {
   _licenseHeaderPage = licenseHeaderPage;
   _licenseReplacer = licenseReplacer;
   _solutionUpdateViewModel = solutionUpdateViewModel;
 }