public void Constructor0_Deny_Unrestricted () { CodeCommentStatementCollection coll = new CodeCommentStatementCollection (); Assert.AreEqual (0, coll.Add (ccs), "Add"); Assert.AreSame (ccs, coll[0], "this[int]"); coll.CopyTo (array, 0); coll.AddRange (array); coll.AddRange (coll); Assert.IsTrue (coll.Contains (ccs), "Contains"); Assert.AreEqual (0, coll.IndexOf (ccs), "IndexOf"); coll.Insert (0, ccs); coll.Remove (ccs); }
private CodeCommentStatementCollection GetSummaryComment(params string[] comments) { CodeCommentStatementCollection collection = new CodeCommentStatementCollection(); if (comments != null && comments.Length > 0) { for (int i = 0; i < comments.Length; i++) if (!String.IsNullOrEmpty(comments[i])) collection.Add(new CodeCommentStatement(comments[i], true)); } if (collection.Count == 0) return collection; collection.Insert(0, new CodeCommentStatement("<summary>", true)); collection.Add(new CodeCommentStatement("</summary>", true)); return collection; }
public void Insert_Null () { CodeCommentStatementCollection coll = new CodeCommentStatementCollection (); coll.Insert (0, (CodeCommentStatement) null); }
public void Insert () { CodeCommentStatement ccs1 = new CodeCommentStatement (); CodeCommentStatement ccs2 = new CodeCommentStatement (); CodeCommentStatementCollection coll = new CodeCommentStatementCollection (); coll.Add (ccs1); Assert.AreEqual (1, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (ccs1), "#2"); coll.Insert (0, ccs2); Assert.AreEqual (2, coll.Count, "#3"); Assert.AreEqual (1, coll.IndexOf (ccs1), "#4"); Assert.AreEqual (0, coll.IndexOf (ccs2), "#5"); }
void Comment(Dictionary<string, Documentation> docs, string name, CodeCommentStatementCollection comments) { if (comments.Count > 0 && comments[0].Comment.Text == "<remarks/>") { comments.RemoveAt(0); } if (docs.ContainsKey(name)) { comments.Insert(0, new CodeCommentStatement("<summary>" + docs[name].Text + "</summary>", true)); docs[name].Used = true; } }