コード例 #1
0
        internal CsComments(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 CsCommentsParamCollection();
            foreach (XmlNode item in param)
            {
                var p = new CsCommentsParam(item);
                Param[p.Name] = p;
            }

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

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

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

            Exception = new CsCommentsException[exception.Count];
            foreach (XmlNode item in exception)
            {
                Exception[index] = new CsCommentsException(index, item);
                index++;
            }
        }
コード例 #2
0
 /// <summary>
 /// 初始化一个<see cref="CsComments"/>类型的实例
 /// </summary>
 private CsComments()
 {
     Param     = new CsCommentsParamCollection();
     TypeParam = new CsCommentsParamCollection();
     Exception = new CsCommentsException[0];
 }