private Guid ParseProjectGuid(Project project)
{
string uniqueName = project.UniqueName;
if (!string.IsNullOrEmpty(uniqueName))
{
int startProjectGuidText = uniqueName.IndexOf("{");
if (startProjectGuidText > -1)
{
int endProjectGuidText = uniqueName.IndexOf("}");
if (endProjectGuidText > -1)
{
Guid projectGuid = Guid.Empty;
Guid.TryParse(uniqueName.Substring(startProjectGuidText, (endProjectGuidText - startProjectGuidText) + 1), out projectGuid);
if (!projectGuid.ToString().Equals(Guid.Empty.ToString()))
return projectGuid;
}
}
}
return Guid.Empty;
}