|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.CodeDom;
namespace XMLtoClass
{
public partial class addCommentWz : Form
{
CodeTypeMember member;
public addCommentWz(ref CodeTypeMember cm)
{
InitializeComponent();
member = cm;
foreach (CodeCommentStatement comment in member.Comments)
{
if (comment.Comment.Text.Contains("summary"))
{
string summary = comment.Comment.Text.Substring(comment.Comment.Text.IndexOf("<summary>"), comment.Comment.Text.IndexOf("</summary>") - comment.Comment.Text.IndexOf("<summary>"));
txtSummary.Text = summary.Replace("<summary>", "").Replace("</summary>","");
}
if (comment.Comment.Text.Contains("remarks"))
{
if (comment.Comment.Text != "<remarks/>")
{
string remarks = comment.Comment.Text.Substring(comment.Comment.Text.IndexOf("<remarks>"), comment.Comment.Text.IndexOf("</remarks>") - comment.Comment.Text.IndexOf("<remarks>"));
txtRemarks.Text = remarks.Replace("<remarks>", "").Replace("</remarks>", "");
}
}
}
}
private void addCommentWz_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
string s = "";
CodeComment comment = new CodeComment();
comment.DocComment = true;
sb.AppendFormat("<summary>{0}</summary>",txtSummary.Text);
// sb.Append("<summary>{0}</summary>", txtSummary.Text);
sb.AppendFormat("<remarks>{0}</remarks>", txtRemarks.Text);
comment.Text = sb.ToString();
member.Comments.Clear();
member.Comments.Add(new CodeCommentStatement(comment));
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.