public ACSessionDto(MeetingSession source, TimeZoneInfo timeZone) { if (source == null) { throw new ArgumentNullException(nameof(source)); } this.participants = new List <ACSessionParticipantDto>(); scoId = source.ScoId; assetId = source.AssetId; dateStarted = FixACValue(source.DateCreated, timeZone); dateEnded = FixACValue(source.DateEnd, timeZone); sessionNumber = int.Parse(source.Version); //sessionName = source.Version; }
/// <summary> /// Parses the specified XML. /// </summary> /// <param name="xml">The XML.</param> /// <returns>Meeting Item or null if it's a folder.</returns> public static MeetingSession Parse(XmlNode xml) { if (xml == null || xml.Attributes == null) { return(null); } try { var item = new MeetingSession { ScoId = xml.SelectAttributeValue("sco-id"), Version = xml.SelectAttributeValue("version"), ParticipantsCount = xml.SelectAttributeValue("num-participants"), AssetId = xml.SelectAttributeValue("asset-id"), DateCreated = xml.ParseNodeDateTime("date-created/text()", default(DateTime)), }; try { item.DateEnd = xml.ParseNodeDateTime("date-end/text()", default(DateTime)); } catch (Exception) { item.DateEnd = default(DateTime); } if (!item.DateCreated.Equals(default(DateTime))) { return(item); } } catch (Exception ex) { TraceTool.TraceException(ex); } return(null); }