18 using erminas.SmartAPI.CMS.Project.Pages.Elements;
19 using erminas.SmartAPI.Utils;
21 namespace erminas.SmartAPI.CMS.Project.ContentClasses.Elements
23 internal class TargetContainerPreassignment
25 private readonly ContentClassElement _element;
26 private Pages.Elements.IContainer _cachedTargetContainer;
28 internal TargetContainerPreassignment(ContentClassElement element)
33 internal bool IsDisplayingConnectedPagesInTargetContainerOfMainLinkIfAvailable
35 get {
return _element.XmlReadWriteWrapper.GetBoolAttributeValue(
"usepagemainlinktargetcontainer").GetValueOrDefault(); }
36 set { _element.XmlReadWriteWrapper.SetAttributeValue(
"usepagemainlinktargetcontainer", value.ToRQLString()); }
39 internal Pages.Elements.IContainer TargetContainer
44 if (!_element.XmlElement.TryGetGuid(
"elttargetcontainerguid", out guid))
49 if (_cachedTargetContainer != null && _cachedTargetContainer.Guid == guid)
51 return _cachedTargetContainer;
55 _cachedTargetContainer =
56 (Pages.Elements.Container)
57 PageElement.CreateElement(_element.ContentClass.Project, guid,
58 _element.Project.LanguageVariants.Current);
62 _element.XmlElement.SetAttributeValue(
"elttargetcontainerguid",
63 value == null ? null : value.Guid.ToRQLString());