private static void HandleErrorOpeningProjectWindow(Exception error, string projectPath)
{
if (_projectContext != null)
{
if (_projectContext.ProjectWindow != null)
{
_projectContext.ProjectWindow.Closed -= HandleProjectWindowClosed;
_projectContext.ProjectWindow.Close();
}
_projectContext.Dispose();
_projectContext = null;
}
SIL.Reporting.ErrorReport.NotifyUserOfProblem(
new SIL.Reporting.ShowAlwaysPolicy(), error,
"{0} had a problem loading the {1} project. Please report this problem to the developers by clicking 'Details' below.",
Application.ProductName, Path.GetFileNameWithoutExtension(projectPath));
}