18 using erminas.SmartAPI.CMS.Project.Pages.Elements;
19 using erminas.SmartAPI.Utils;
21 namespace erminas.SmartAPI.CMS.Project.Pages
23 internal class LinkingAndAppearance : ILinkingAndAppearance
25 internal LinkingAndAppearance(IPage page, XmlElement element)
31 public DateTime AppearenceEnd {
get;
private set; }
32 public DateTime AppearenceStart {
get;
private set; }
36 get {
return Link.Guid; }
39 public bool HasAppearenceEnd
41 get {
return AppearenceEnd != DateTime.MaxValue; }
44 public bool HasAppearenceStart
46 get {
return AppearenceStart != DateTime.MinValue; }
49 public bool IsActive {
get;
private set; }
54 get {
return Link.
Name; }
57 public IPage Page {
get;
private set; }
59 public IProject Project
61 get {
return Page.Project; }
64 public ISession Session
66 get {
return Page.Session; }
69 private void LoadXml(XmlElement element)
71 Link = (
ILinkElement) PageElement.CreateElement(Project, element);
73 var start = element.GetOADate(
"startdate");
74 AppearenceStart = !start.HasValue ? DateTime.MinValue : start.Value;
76 var end = element.GetOADate(
"enddate");
77 AppearenceEnd = !end.HasValue ? DateTime.MaxValue : end.Value;
79 var dateState = element.GetIntAttributeValue(
"datestate").GetValueOrDefault();
80 IsActive = dateState == 1 || dateState == 3;
86 DateTime AppearenceEnd {
get; }
87 DateTime AppearenceStart {
get; }
89 bool HasAppearenceEnd {
get; }
90 bool HasAppearenceStart {
get; }
92 bool IsActive {
get; }