public OpenChatRoomType(pOpenChatRoomType c) : base(c.Time) { this.room = c.Room; if (null != c.Owner) this.owner = c.Owner; NameLists.chatroomNames.New(c.Room, null);//Do not care if open references a previous name as scenario might legally reuse names or use conditionally. for (int i = 0; i < c.Members.Count; i++) { if (!UnitFacts.IsDM(c.Members[i])) throw new ApplicationException("Cannot add nonexistent decision maker " + c.Members[i] + " to chat room " + c.Room); } this.members = c.Members; // Assignment after because parser creates new list each time }
public override pOpenChatRoomType pGetOpenChatRoom() { pOpenChatRoomType returnValue; string room = "Unknown chat room"; int time; List<string> memberList; try { reader.Read(); room = pGetString(); time = pGetInt(); returnValue = new pOpenChatRoomType(room, time); if ("Owner" == reader.Name) { returnValue.Owner = pGetString(); } while ("Members" == reader.Name) { memberList = pGetStringList(commaRegex); returnValue.Add(memberList); } reader.ReadEndElement(); return returnValue; } catch (SystemException e) { throw new ApplicationException("Could not read OpenChatRoom for room " + room, e); } }