private void AddProjectVariants(IProject project, XmlElement template)
{
XmlElement projectVariants = template.AddElement("PROJECTVARIANTS");
projectVariants.AddAttribute("action", "assign");
foreach (IProjectVariant curVariant in Project.ProjectVariants)
{
XmlElement projectVariant = projectVariants.AddElement("PROJECTVARIANT");
IProjectVariant otherVariant;
if (!project.ProjectVariants.TryGetByName(curVariant.Name, out otherVariant))
{
throw new SmartAPIException(Session.ServerLogin,
string.Format("Could not find project variant {0} in project {1}",
curVariant.Name, project.Name));
}
projectVariant.AddAttribute("guid", otherVariant.Guid.ToRQLString());
}
}