本文整理汇总了C#中System.CodeDom.CodeCommentStatementCollection类的典型用法代码示例。如果您正苦于以下问题:C# CodeCommentStatementCollection类的具体用法?C# CodeCommentStatementCollection怎么用?C# CodeCommentStatementCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeCommentStatementCollection类属于System.CodeDom命名空间,在下文中一共展示了CodeCommentStatementCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CodeNamespace
public CodeNamespace()
{
this.imports = new CodeNamespaceImportCollection();
this.comments = new CodeCommentStatementCollection();
this.classes = new CodeTypeDeclarationCollection();
this.namespaces = new CodeNamespaceCollection();
}
示例2: Constructor1_NullItem
public void Constructor1_NullItem ()
{
CodeCommentStatement[] statements = new CodeCommentStatement[] {
new CodeCommentStatement (), null };
CodeCommentStatementCollection coll = new CodeCommentStatementCollection (
statements);
}
示例3: CreateSummaryComment
/// <summary>
/// Add to CodeCommentStatementCollection summary documentation
/// </summary>
/// <param name="codeStatmentColl">Collection of CodeCommentStatement</param>
/// <param name="comment">summary text</param>
internal static void CreateSummaryComment(CodeCommentStatementCollection codeStatmentColl, string comment)
{
codeStatmentColl.Add(new CodeCommentStatement("<summary>", true));
string[] lines = comment.Split(new[] { '\n' });
foreach (string line in lines)
codeStatmentColl.Add(new CodeCommentStatement(line.Trim(), true));
codeStatmentColl.Add(new CodeCommentStatement("</summary>", true));
}
示例4: Clone
public static CodeCommentStatementCollection Clone(CodeCommentStatementCollection codestatementcol)
{
var col = new CodeCommentStatementCollection();
foreach(CodeCommentStatement cstat in codestatementcol) {
col.Add(Clone(cstat));
}
return col;
}
示例5: Constructor0
public void Constructor0 ()
{
CodeCommentStatementCollection coll = new CodeCommentStatementCollection ();
Assert.IsFalse (((IList) coll).IsFixedSize, "#1");
Assert.IsFalse (((IList) coll).IsReadOnly, "#2");
Assert.AreEqual (0, coll.Count, "#3");
Assert.IsFalse (((ICollection) coll).IsSynchronized, "#4");
Assert.IsNotNull (((ICollection) coll).SyncRoot, "#5");
}
示例6: GetDocumentCommentString
public static string GetDocumentCommentString(CodeCommentStatementCollection comments)
{
var info = new StringBuilder();
foreach(CodeCommentStatement com in comments) {
if(com.Comment.DocComment)
info.AppendLine(com.Comment.Text);
}
return info.ToString();
}
示例7: 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;
}
}
示例8: EmitSummaryComments
/// <summary>
/// emit all the documentation comments for an element's documentation child
/// (if the element does not have a documentation child emit some standard "missing comments" comment
/// </summary>
/// <param name="element">the element whose documentation is to be displayed</param>
/// <param name="commentCollection">the comment collection of the CodeDom object to be commented</param>
public static void EmitSummaryComments(MetadataItem item, CodeCommentStatementCollection commentCollection)
{
Debug.Assert(item != null, "item parameter is null");
Debug.Assert(commentCollection != null, "commentCollection parameter is null");
Documentation documentation = GetDocumentation(item);
string [] summaryComments = null;
if (documentation != null && !MetadataUtil.IsNullOrEmptyOrWhiteSpace(documentation.Summary))
{
// we have documentation to emit
summaryComments = GetFormattedLines(documentation.Summary, true);
}
else
{
string summaryComment;
// no summary content, so use a default
switch (item.BuiltInTypeKind)
{
case BuiltInTypeKind.EdmProperty:
summaryComment = Strings.MissingPropertyDocumentation(((EdmProperty)item).Name);
break;
case BuiltInTypeKind.ComplexType:
summaryComment = Strings.MissingComplexTypeDocumentation(((ComplexType)item).FullName);
break;
default:
{
PropertyInfo pi = item.GetType().GetProperty("FullName");
if (pi == null)
{
pi = item.GetType().GetProperty("Name");
}
object value = null;
if (pi != null)
{
value = pi.GetValue(item, null);
}
if (value != null)
{
summaryComment = Strings.MissingDocumentation(value.ToString());
}
else
{
summaryComment = Strings.MissingDocumentationNoName;
}
}
break;
}
summaryComments = new string[] { summaryComment };
}
EmitSummaryComments(summaryComments, commentCollection);
EmitOtherDocumentationComments(documentation, commentCollection);
}
示例9: AddRange
public void AddRange(CodeCommentStatementCollection value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
int count = value.Count;
for (int i = 0; i < count; i++)
{
this.Add(value[i]);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:CodeCommentStatementCollection.cs
示例10: Constructor1
public void Constructor1 ()
{
CodeCommentStatement ccs1 = new CodeCommentStatement ();
CodeCommentStatement ccs2 = new CodeCommentStatement ();
CodeCommentStatement[] statements = new CodeCommentStatement[] { ccs1, ccs2 };
CodeCommentStatementCollection coll = new CodeCommentStatementCollection (
statements);
Assert.AreEqual (2, coll.Count, "#1");
Assert.AreEqual (0, coll.IndexOf (ccs1), "#2");
Assert.AreEqual (1, coll.IndexOf (ccs2), "#3");
}
示例11: Constructor1_Deny_Unrestricted
public void Constructor1_Deny_Unrestricted ()
{
CodeCommentStatementCollection coll = new CodeCommentStatementCollection (array);
coll.CopyTo (array, 0);
Assert.AreEqual (1, coll.Add (ccs), "Add");
Assert.AreSame (ccs, coll[0], "this[int]");
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);
}
示例12: AddFileBanner
private CodeCommentStatementCollection AddFileBanner(string sInFile, string sOutFile)
{
CodeCommentStatementCollection coll = new CodeCommentStatementCollection();
coll.Add(new CodeCommentStatement("--------------------------------------------------------------------------------------------"));
coll.Add(new CodeCommentStatement(string.Format(
"Copyright (c) {0}, SIL International. All rights reserved.", DateTime.Now.Year)));
coll.Add(new CodeCommentStatement(""));
coll.Add(new CodeCommentStatement("File: " + Path.GetFileName(sOutFile)));
coll.Add(new CodeCommentStatement("Responsibility: Generated by IDLImporter"));
coll.Add(new CodeCommentStatement("Last reviewed: "));
coll.Add(new CodeCommentStatement(""));
coll.Add(new CodeCommentStatement("<remarks>"));
coll.Add(new CodeCommentStatement("Generated by IDLImporter from file " + Path.GetFileName(sInFile)));
coll.Add(new CodeCommentStatement(""));
coll.Add(new CodeCommentStatement("You should use these interfaces when you access the COM objects defined in the mentioned"));
coll.Add(new CodeCommentStatement("IDL/IDH file."));
coll.Add(new CodeCommentStatement("</remarks>"));
coll.Add(new CodeCommentStatement("--------------------------------------------------------------------------------------------"));
return coll;
}
示例13: AddExtensionWarningComments
public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions)
{
foreach (object obj2 in extensions)
{
if (!extensions.IsHandled(obj2))
{
string localName = null;
string namespaceURI = null;
if (obj2 is XmlElement)
{
XmlElement element = (XmlElement) obj2;
localName = element.LocalName;
namespaceURI = element.NamespaceURI;
}
else if (obj2 is ServiceDescriptionFormatExtension)
{
XmlFormatExtensionAttribute[] customAttributes = (XmlFormatExtensionAttribute[]) obj2.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false);
if (customAttributes.Length > 0)
{
localName = customAttributes[0].ElementName;
namespaceURI = customAttributes[0].Namespace;
}
}
if (localName != null)
{
if (extensions.IsRequired(obj2))
{
this.warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored;
AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredRequired", new object[] { localName, namespaceURI }));
}
else
{
this.warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored;
AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredOptional", new object[] { localName, namespaceURI }));
}
}
}
}
}
示例14: Constructor1_Null
public void Constructor1_Null () {
CodeCommentStatementCollection coll = new CodeCommentStatementCollection (
(CodeCommentStatement[]) null);
}
示例15: GenerateCommentStatements
protected override void GenerateCommentStatements(CodeCommentStatementCollection e)
{
foreach (CodeCommentStatement statement in e)
{
if (!this.IsDocComment(statement))
{
this.GenerateCommentStatement(statement);
}
}
foreach (CodeCommentStatement statement2 in e)
{
if (this.IsDocComment(statement2))
{
this.GenerateCommentStatement(statement2);
}
}
}