Bloom.Workspace.WorkspaceView.RestartBloom C# (CSharp) Method

RestartBloom() private method

private RestartBloom ( string newInstallDir ) : void
newInstallDir string
return void
        private void RestartBloom(string newInstallDir)
        {
            Control ancestor = Parent;
            while (ancestor != null && !(ancestor is Shell))
                ancestor = ancestor.Parent;
            if (ancestor == null)
                return;
            var shell = (Shell) ancestor;
            var pathToNewExe = Path.Combine(newInstallDir, Path.ChangeExtension(Application.ProductName, ".exe"));
            if (!RobustFile.Exists(pathToNewExe))
                return; // aargh!
            shell.QuitForVersionUpdate = true;
            Process.Start(pathToNewExe);
            Thread.Sleep(2000);
            shell.Close();
        }