Exemple #1
0
        /// <summary> 构造一个 CSComment 对象
        /// </summary>
        /// <param name="node">表示成员注释的节点</param>
        internal CSComment(XmlNode node)
        {
            var summary = node["summary"] ?? node["value"];

            if (summary != null)
            {
                Summary = summary.InnerText.Trim();
            }
            var remarks = node["remarks"];

            if (remarks != null)
            {
                Remarks = remarks.InnerText.Trim();;
            }
            var returns = node["returns"];

            if (returns != null)
            {
                Returns = returns.InnerText.Trim();;
            }
            var param = node.SelectNodes("param");

            Param = new CSCommentParamCollection();
            foreach (XmlNode item in param)
            {
                var p = new CSCommentParam(item);
                Param[p.Name] = p;
            }

            var typeparam = node.SelectNodes("typeparam");

            TypeParam = new CSCommentParamCollection();
            foreach (XmlNode item in typeparam)
            {
                var p = new CSCommentParam(item);
                TypeParam[p.Name] = p;
            }

            var exception = node.SelectNodes("exception");
            var index     = 0;

            Exception = new CSCommentException[exception.Count];
            foreach (XmlNode ex in exception)
            {
                Exception[index] = new CSCommentException(index, ex);
                index++;
            }
        }
Exemple #2
0
 private CSComment()
 {
     Param     = new CSCommentParamCollection();
     TypeParam = new CSCommentParamCollection();
     Exception = new CSCommentException[0];
 }