コード例 #1
0
        public virtual void Load(SerializationReader SR)
        {
            SR.ReadStartElement();
            int version = SR.ReadVersion();

            switch (version)
            {
            case 0:
            {
                Author  = SR.ReadString();
                Create  = SR.ReadString();
                Message = SR.ReadString();

                SR.ReadStartElement();
                int length = SR.ReadInt();
                for (int i = 0; i < length; i++)
                {
                    ForumMessage baseforum = SR.ReadType() as ForumMessage;
                    if (baseforum != null)
                    {
                        baseforum.Load(SR);
                        Add(baseforum);
                    }
                }
                SR.ReadEndElement();
                break;
            }
            }
            SR.ReadEndElement();
        }
コード例 #2
0
        public void Forum_Response_New(string[] str)
        {
            string title      = str[1];
            string src_author = str[2];
            string src_create = str[3];
            string author     = str[4];
            string message    = str[5];

            Forum forum = Info.ForumList.Find(title);

            if (forum == null)
            {
                return;
            }

            ForumMessage forumMessage = forum.Find(src_author, src_create);

            if (forumMessage == null)
            {
                return;
            }

            ForumMessage forummessage = new ForumMessage();

            forummessage.Author  = author;
            forummessage.Message = message;
            forumMessage.Add(forummessage);

            string path = Info.address_Forum + forum.FileName();

            Info.SaveFileForum(forum, path);

            Add(new MsgJSON_Forum("FORUM", forum));
        }
コード例 #3
0
        public void Add(ForumMessage forum)
        {
            ForumMessage[] temp = new ForumMessage[Responses.Length + 1];
            for (int i = 0; i < Responses.Length; i++)
            {
                temp[i] = Responses[i];
            }

            temp[Responses.Length] = forum;
            Responses = temp;
        }
コード例 #4
0
 public class MsgJSON_Forum : MessageJSON { public ForumMessage Forum; public MsgJSON_Forum(string command, ForumMessage forum) : base(command)
                                            {
                                                Forum = forum;
                                            }