18 using erminas.SmartAPI.Utils;
20 namespace erminas.SmartAPI.CMS.Project
24 bool IsUsedAsDisplayFormat {
get; }
25 bool IsUserDisplayVariant {
get; }
28 public static class ProjectVariantFactory
30 public static IProjectVariant CreateFromGuid(IProject project, Guid guid)
32 return new ProjectVariant(project, guid);
36 internal class ProjectVariant : PartialRedDotProjectObject, IProjectVariant
38 internal ProjectVariant(IProject project, Guid guid) : base(project, guid)
42 internal ProjectVariant(IProject project, XmlElement xmlElement) : base(project, xmlElement)
46 public bool IsUsedAsDisplayFormat
50 string value = XmlElement.GetAttributeValue(
"checked");
51 return value != null && value ==
"1";
55 public bool IsUserDisplayVariant
59 string value = XmlElement.GetAttributeValue(
"userdisplayvariant");
64 protected override void LoadWholeObject()
68 protected override XmlElement RetrieveWholeObject()
70 const string LOAD_PROJECT_VARIANT =
71 @"<PROJECT><PROJECTVARIANTS action=""load""><PROJECTVARIANT guid=""{0}"" /></PROJECTVARIANTS></PROJECT>";
73 XmlDocument xmlDoc = Project.ExecuteRQL(
string.Format(LOAD_PROJECT_VARIANT, Guid.ToRQLString()));
74 return (XmlElement) xmlDoc.GetElementsByTagName(
"PROJECTVARIANT")[0];