private void fillSeatCells(string cellXml) { this.SeatCells = new List<CellCoordinate>(); this.dicSeatCells = new Dictionary<string, CellCoordinate>(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml("<Points>" + cellXml + "</Points>"); foreach (XmlElement elmPoint in xmlDoc.DocumentElement.SelectNodes("P")) { bool enabled = true ; if (!string.IsNullOrWhiteSpace(elmPoint.GetAttribute("enabled"))) { if (elmPoint.GetAttribute("enabled").ToUpper() == "FALSE") enabled = false ; } CellCoordinate cell = new CellCoordinate(int.Parse(elmPoint.GetAttribute("x")), int.Parse(elmPoint.GetAttribute("y")), elmPoint.GetAttribute("content"), enabled); this.SeatCells.Add(cell); string key = cell.X.ToString() + "_" + cell.Y.ToString(); if (!this.dicSeatCells.ContainsKey(key)) this.dicSeatCells.Add(key, cell); } }
private void fillBoundayCells(string cellXml) { this.BoundaryCells = new List<CellCoordinate>(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml("<Points>" + cellXml + "</Points>"); foreach (XmlElement elmPoint in xmlDoc.DocumentElement.SelectNodes("P")) { CellCoordinate cell = new CellCoordinate(int.Parse(elmPoint.GetAttribute("x")), int.Parse(elmPoint.GetAttribute("y")), elmPoint.GetAttribute("content")); this.BoundaryCells.Add(cell); } }