private static ProjectId GetBestGuessProjectId(string latestProject, string latestServer)
{
// From the provided server/project pair, return the best possible ProjectId object.
var projId = new ProjectId(latestProject, latestServer);
if (string.IsNullOrEmpty(latestServer))
{
// the extension we inferred from the current server type might be wrong;
// most likely, it might be a fwdata file that was not to be converted.
// An fwdb which didn't convert back is less likely but try to handle it.
if (!File.Exists(projId.Path))
{
string altProject;
if (Path.GetExtension(latestProject) == FdoFileHelper.ksFwDataXmlFileExtension)
altProject = Path.ChangeExtension(latestProject, FdoFileHelper.ksFwDataDb4oFileExtension);
else
altProject = Path.ChangeExtension(latestProject, FdoFileHelper.ksFwDataXmlFileExtension);
projId = new ProjectId(altProject, latestServer);
}
}
return projId;
}