private void EnsureEndTimestamp(Entry entry, XElement element) { if (entry.HasTimestamp && _boundary.Boundries.Count > 0) if (element.Attribute(AttribEnd) == null) element.Add(new XAttribute(AttribEnd, entry.Timestamp.ToString(DateFormat))); if (entry.HasTimestamp) if (element.Parent != null && element.Parent.Attribute(AttribEnd) == null) element.Parent.Add(new XAttribute(AttribEnd, entry.Timestamp.ToString(DateFormat))); else if (element.Parent != null && element.Parent.Attributes(AttribEnd).Any()) element.Parent.Attributes(AttribEnd).First().Value = entry.Timestamp.ToString(DateFormat); }
private void EnsureEndTimestamp(Entry entry, XElement element) { if (entry.HasTimestamp && _boundary.Boundries.Count > 0 && element.Attribute("end") == null) { element.Add(new XAttribute("end", entry.Timestamp.ToString("yyyy-MM-ddThh:mm:ss"))); } if (entry.HasTimestamp) { if (element.Parent != null && element.Parent.Attribute("end") == null) { element.Parent.Add(new XAttribute("end", entry.Timestamp.ToString("yyyy-MM-ddThh:mm:ss"))); return; } if (element.Parent != null && element.Parent.Attributes("end").Any<XAttribute>()) { element.Parent.Attributes("end").First<XAttribute>().Value = entry.Timestamp.ToString("yyyy-MM-ddThh:mm:ss"); } } }
private static void EnsureStartTimestamp(Entry entry, XElement element) { if (entry.HasTimestamp) { element.Add(new XAttribute(AttribStart, entry.Timestamp.ToString(DateFormat))); if (element.Parent != null && element.Parent.Attribute(AttribStart) == null) element.Parent.Add(new XAttribute(AttribStart, entry.Timestamp.ToString(DateFormat))); } }
private static void EnsureStartTimestamp(Entry entry, XElement element) { if (entry.HasTimestamp) { element.Add(new XAttribute("start", entry.Timestamp.ToString("yyyy-MM-ddThh:mm:ss"))); if (element.Parent != null && element.Parent.Attribute("start") == null) { element.Parent.Add(new XAttribute("start", entry.Timestamp.ToString("yyyy-MM-ddThh:mm:ss"))); } } }