本文整理汇总了C#中System.CodeDom.CodeCommentStatementCollection.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# CodeCommentStatementCollection.Insert方法的具体用法?C# CodeCommentStatementCollection.Insert怎么用?C# CodeCommentStatementCollection.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.CodeDom.CodeCommentStatementCollection
的用法示例。
在下文中一共展示了CodeCommentStatementCollection.Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor0_Deny_Unrestricted
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);
}
示例2: GetSummaryComment
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;
}
示例3: Insert_Null
public void Insert_Null ()
{
CodeCommentStatementCollection coll = new CodeCommentStatementCollection ();
coll.Insert (0, (CodeCommentStatement) null);
}
示例4: Insert
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");
}
示例5: Comment
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;
}
}