示例#1
0
        public CT_Comment InsertNewComment(int index)
        {
            if (null == commentField)
            {
                commentField = new List <CT_Comment>();
            }
            CT_Comment com = new CT_Comment();

            commentField.Insert(index, com);
            return(com);
        }
示例#2
0
        public CT_Comment AddNewComment()
        {
            if (null == commentField)
            {
                commentField = new List <CT_Comment>();
            }
            CT_Comment com = new CT_Comment();

            commentField.Add(com);
            return(com);
        }
示例#3
0
        public static CT_CommentList Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_CommentList ctObj = new CT_CommentList();

            ctObj.comment = new List <CT_Comment>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "comment")
                {
                    ctObj.comment.Add(CT_Comment.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
示例#4
0
        private string guidField = null;         // optional attribute

        //public CT_Comment()
        //{
        //    this.textField = new CT_Rst();
        //}
        public static CT_Comment Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Comment ctObj = new CT_Comment();

            ctObj.@ref = XmlHelper.ReadString(node.Attribute("ref"));
            if (node.Attribute("authorId") != null)
            {
                ctObj.authorId = XmlHelper.ReadUInt(node.Attribute("authorId"));
            }
            ctObj.guid = XmlHelper.ReadString(node.Attribute("guid"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "text")
                {
                    ctObj.text = CT_Rst.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }