private void ParseLevels(Wing wing, XmlNodeList levelNodes) { foreach (var node in levelNodes) { XmlElement levelNode = (XmlElement)node; Level lvl = new Level(); lvl.Name = levelNode.GetAttribute("Name"); ParseRooms(lvl, levelNode.GetElementsByTagName("Room")); wing.Level.Add(lvl); } }
private void ParseRooms(Level lvl, XmlNodeList roomNodes) { foreach (var node in roomNodes) { XmlElement roomNode = (XmlElement)node; Room room = new Room(); room.RoomId = roomNode.GetAttribute("RoomId"); room.RoomName = roomNode.GetAttribute("RoomName"); room.Tables = int.Parse(roomNode.GetAttribute("Tables")); room.Chairs = int.Parse(roomNode.GetAttribute("Chairs")); room.Computers = int.Parse(roomNode.GetAttribute("Computers")); room.Extras = ((RoomExtras) Enum.Parse(typeof (RoomExtras), roomNode.GetAttribute("Extras"))); room.ChairType = ((RoomChairTypes) Enum.Parse(typeof (RoomChairTypes), roomNode.GetAttribute("ChairType"))); lvl.Room.Add(room); } }
/// <summary> /// Create a new Level object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static Level CreateLevel(global::System.Int32 id, global::System.String name) { Level level = new Level(); level.Id = id; level.Name = name; return level; }
/// <summary> /// Deprecated Method for adding a new object to the LevelSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToLevelSet(Level level) { base.AddObject("LevelSet", level); }
public DesignDataService() { Wings = new Wing[0]; Levels = new Level[0]; Rooms = new Room[0]; }