public AveragingPeriod(XmlNode xmlNode) { XmlNodeList scheduleNodeList = xmlNode.SelectNodes("schedule"); foreach (XmlNode item in scheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scheduleIDRef = item.Attributes["id"].Name; List<AveragingSchedule> ob = new List<AveragingSchedule>(); ob.Add(new AveragingSchedule(item)); IDManager.SetID(scheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { scheduleIDRef = item.Attributes["href"].Name; } else { schedule.Add(new AveragingSchedule(item)); } } } XmlNodeList averagingDateTimesNodeList = xmlNode.SelectNodes("averagingDateTimes"); if (averagingDateTimesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in averagingDateTimesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingDateTimesIDRef = item.Attributes["id"].Name; DateTimeList ob = DateTimeList(); IDManager.SetID(averagingDateTimesIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingDateTimesIDRef = item.Attributes["href"].Name; } else { averagingDateTimes = new DateTimeList(item); } } } XmlNodeList averagingObservationsNodeList = xmlNode.SelectNodes("averagingObservations"); if (averagingObservationsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in averagingObservationsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingObservationsIDRef = item.Attributes["id"].Name; AveragingObservationList ob = AveragingObservationList(); IDManager.SetID(averagingObservationsIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingObservationsIDRef = item.Attributes["href"].Name; } else { averagingObservations = new AveragingObservationList(item); } } } XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption"); if (marketDisruptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in marketDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketDisruptionIDRef = item.Attributes["id"].Name; MarketDisruption ob = MarketDisruption(); IDManager.SetID(marketDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketDisruptionIDRef = item.Attributes["href"].Name; } else { marketDisruption = new MarketDisruption(item); } } } }
public AveragingPeriod(XmlNode xmlNode) { XmlNodeList scheduleNodeList = xmlNode.SelectNodes("schedule"); if (scheduleNodeList != null) { this.schedule_ = new List<AveragingSchedule>(); foreach (XmlNode item in scheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { scheduleIDRef_ = item.Attributes["id"].Value; schedule_.Add(new AveragingSchedule(item)); IDManager.SetID(scheduleIDRef_, schedule_[schedule_.Count - 1 ]); } else if (item.Attributes["href"] != null) { scheduleIDRef_ = item.Attributes["href"].Value; } else { schedule_.Add(new AveragingSchedule(item)); } } else { schedule_.Add(new AveragingSchedule(item)); } } } XmlNode averagingDateTimesNode = xmlNode.SelectSingleNode("averagingDateTimes"); if (averagingDateTimesNode != null) { if (averagingDateTimesNode.Attributes["href"] != null || averagingDateTimesNode.Attributes["id"] != null) { if (averagingDateTimesNode.Attributes["id"] != null) { averagingDateTimesIDRef_ = averagingDateTimesNode.Attributes["id"].Value; DateTimeList ob = new DateTimeList(averagingDateTimesNode); IDManager.SetID(averagingDateTimesIDRef_, ob); } else if (averagingDateTimesNode.Attributes["href"] != null) { averagingDateTimesIDRef_ = averagingDateTimesNode.Attributes["href"].Value; } else { averagingDateTimes_ = new DateTimeList(averagingDateTimesNode); } } else { averagingDateTimes_ = new DateTimeList(averagingDateTimesNode); } } XmlNode averagingObservationsNode = xmlNode.SelectSingleNode("averagingObservations"); if (averagingObservationsNode != null) { if (averagingObservationsNode.Attributes["href"] != null || averagingObservationsNode.Attributes["id"] != null) { if (averagingObservationsNode.Attributes["id"] != null) { averagingObservationsIDRef_ = averagingObservationsNode.Attributes["id"].Value; AveragingObservationList ob = new AveragingObservationList(averagingObservationsNode); IDManager.SetID(averagingObservationsIDRef_, ob); } else if (averagingObservationsNode.Attributes["href"] != null) { averagingObservationsIDRef_ = averagingObservationsNode.Attributes["href"].Value; } else { averagingObservations_ = new AveragingObservationList(averagingObservationsNode); } } else { averagingObservations_ = new AveragingObservationList(averagingObservationsNode); } } XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption"); if (marketDisruptionNode != null) { if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) { if (marketDisruptionNode.Attributes["id"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value; MarketDisruption ob = new MarketDisruption(marketDisruptionNode); IDManager.SetID(marketDisruptionIDRef_, ob); } else if (marketDisruptionNode.Attributes["href"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value; } else { marketDisruption_ = new MarketDisruption(marketDisruptionNode); } } else { marketDisruption_ = new MarketDisruption(marketDisruptionNode); } } }
public AveragingPeriod(XmlNode xmlNode) { XmlNodeList scheduleNodeList = xmlNode.SelectNodes("schedule"); if (scheduleNodeList != null) { this.schedule_ = new List <AveragingSchedule>(); foreach (XmlNode item in scheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { scheduleIDRef_ = item.Attributes["id"].Value; schedule_.Add(new AveragingSchedule(item)); IDManager.SetID(scheduleIDRef_, schedule_[schedule_.Count - 1]); } else if (item.Attributes["href"] != null) { scheduleIDRef_ = item.Attributes["href"].Value; } else { schedule_.Add(new AveragingSchedule(item)); } } else { schedule_.Add(new AveragingSchedule(item)); } } } XmlNode averagingDateTimesNode = xmlNode.SelectSingleNode("averagingDateTimes"); if (averagingDateTimesNode != null) { if (averagingDateTimesNode.Attributes["href"] != null || averagingDateTimesNode.Attributes["id"] != null) { if (averagingDateTimesNode.Attributes["id"] != null) { averagingDateTimesIDRef_ = averagingDateTimesNode.Attributes["id"].Value; DateTimeList ob = new DateTimeList(averagingDateTimesNode); IDManager.SetID(averagingDateTimesIDRef_, ob); } else if (averagingDateTimesNode.Attributes["href"] != null) { averagingDateTimesIDRef_ = averagingDateTimesNode.Attributes["href"].Value; } else { averagingDateTimes_ = new DateTimeList(averagingDateTimesNode); } } else { averagingDateTimes_ = new DateTimeList(averagingDateTimesNode); } } XmlNode averagingObservationsNode = xmlNode.SelectSingleNode("averagingObservations"); if (averagingObservationsNode != null) { if (averagingObservationsNode.Attributes["href"] != null || averagingObservationsNode.Attributes["id"] != null) { if (averagingObservationsNode.Attributes["id"] != null) { averagingObservationsIDRef_ = averagingObservationsNode.Attributes["id"].Value; AveragingObservationList ob = new AveragingObservationList(averagingObservationsNode); IDManager.SetID(averagingObservationsIDRef_, ob); } else if (averagingObservationsNode.Attributes["href"] != null) { averagingObservationsIDRef_ = averagingObservationsNode.Attributes["href"].Value; } else { averagingObservations_ = new AveragingObservationList(averagingObservationsNode); } } else { averagingObservations_ = new AveragingObservationList(averagingObservationsNode); } } XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption"); if (marketDisruptionNode != null) { if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) { if (marketDisruptionNode.Attributes["id"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value; MarketDisruption ob = new MarketDisruption(marketDisruptionNode); IDManager.SetID(marketDisruptionIDRef_, ob); } else if (marketDisruptionNode.Attributes["href"] != null) { marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value; } else { marketDisruption_ = new MarketDisruption(marketDisruptionNode); } } else { marketDisruption_ = new MarketDisruption(marketDisruptionNode); } } }
public AveragingPeriod(XmlNode xmlNode) { XmlNodeList scheduleNodeList = xmlNode.SelectNodes("schedule"); foreach (XmlNode item in scheduleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scheduleIDRef = item.Attributes["id"].Name; List <AveragingSchedule> ob = new List <AveragingSchedule>(); ob.Add(new AveragingSchedule(item)); IDManager.SetID(scheduleIDRef, ob); } else if (item.Attributes.ToString() == "href") { scheduleIDRef = item.Attributes["href"].Name; } else { schedule.Add(new AveragingSchedule(item)); } } } XmlNodeList averagingDateTimesNodeList = xmlNode.SelectNodes("averagingDateTimes"); if (averagingDateTimesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in averagingDateTimesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingDateTimesIDRef = item.Attributes["id"].Name; DateTimeList ob = DateTimeList(); IDManager.SetID(averagingDateTimesIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingDateTimesIDRef = item.Attributes["href"].Name; } else { averagingDateTimes = new DateTimeList(item); } } } XmlNodeList averagingObservationsNodeList = xmlNode.SelectNodes("averagingObservations"); if (averagingObservationsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in averagingObservationsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { averagingObservationsIDRef = item.Attributes["id"].Name; AveragingObservationList ob = AveragingObservationList(); IDManager.SetID(averagingObservationsIDRef, ob); } else if (item.Attributes.ToString() == "href") { averagingObservationsIDRef = item.Attributes["href"].Name; } else { averagingObservations = new AveragingObservationList(item); } } } XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption"); if (marketDisruptionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in marketDisruptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketDisruptionIDRef = item.Attributes["id"].Name; MarketDisruption ob = MarketDisruption(); IDManager.SetID(marketDisruptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketDisruptionIDRef = item.Attributes["href"].Name; } else { marketDisruption = new MarketDisruption(item); } } } }