Пример #1
0
 public CloseChatRoomType(pCloseChatRoomType c)
     : base(c.Time)
 {
     if (!NameLists.chatroomNames.ContainsKey(c.Room)) throw new ApplicationException("Cannot close non-existent chat room " + c.Room);
     this.Time = c.Time;
     this.room = c.Room;
     if (null != c.Requestor)
         this.requestor = c.Requestor;
 }
Пример #2
0
        /* Not yet ready for implementation
                public pDropChattersType pGetDropChatters()
                {
                    pDropChattersType returnValue;
                    string room = "Unknown chat room";
                    int time;
                    List<string> memberList;
                    try
                    {
                        reader.Read();
                        room = pGetString();
                        time = pGetInt();
                        returnValue = new pDropChattersType(room, time);
                        while ("Members" == reader.Name)
                        {
                            memberList = pGetStringList(commaeRegex);
                            returnValue.Add(memberList);
                        }
                        reader.ReadEndElement();
                        return returnValue;

                    }
                    catch (SystemException e)
                    {
                        throw new ApplicationException("Could not read DropChatters for room " + room, e);
                    }
                }
                public pAddChattersType pGetAddChatters()
                {
                    pAddChattersType returnValue;
                    string room = "Unknown chat room";
                    int time;
                    List<string> memberList;
                    try
                    {
                        reader.Read();
                        room = pGetString();
                        time = pGetInt();
                        returnValue = new pAddChattersType(room, time);
                        while ("Members" == reader.Name)
                        {
                            memberList = pGetStringList(commaRegex     );
                            returnValue.Add(memberList);
                        }

                        reader.ReadEndElement();
                        return returnValue;
                    }
                    catch (SystemException e)
                    {
                        throw new ApplicationException("Could not read AddChatters for room " + room, e);
                    }
                }

         */

        public override pCloseChatRoomType pGetCloseChatRoom()
        {
            pCloseChatRoomType returnValue;
            string room = "Unknown chat room";
            int time;
            try
            {
                reader.Read();
                room = pGetString();
                time = pGetInt();

                returnValue = new pCloseChatRoomType(room, time);
                if ("Requestor" == reader.Name)
                    returnValue.Requestor = pGetString();
                reader.ReadEndElement();
                return returnValue;
            }
            catch (SystemException e)
            {
                throw new ApplicationException("Could not read CloseChatRoom for room " + room, e);
            }
        }