public static void AddPrecedingComments(this CodeCommentStatementCollection codeCommentStatementCollection, XpidlComplexNode xpidlComplexNode, Int32 currentIndex) { foreach (XpidlComment xpidlComment in xpidlComplexNode.CommentsBefore(currentIndex)) { codeCommentStatementCollection.AddComment(xpidlComment.CommentBody); } }
/// <summary> /// 在容器末尾增加一个注释节点 /// </summary> /// <param name="modifier">DOM 结构修改器</param> /// <param name="container">要添加注释的容器</param> /// <param name="comment">HTML注释</param> /// <returns>添加的注释节点</returns> public static IHtmlComment AddComment( this IHtmlDomModifier modifier, IHtmlContainer container, string comment ) { if ( modifier == null ) throw new ArgumentNullException( "modifier" ); if ( container == null ) throw new ArgumentNullException( "container" ); if ( comment == null ) throw new ArgumentNullException( "comment" ); lock ( container.SyncRoot ) { return modifier.AddComment( container, container.Nodes().Count(), comment ); } }
/// <summary> /// Adds the lines as doc comment to a field. /// </summary> /// <param name="field">The field.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same field.</returns> public static CodeMemberField AddCommentLines(this CodeMemberField field, IEnumerable<string> lines) { foreach (var line in lines) { field.AddComment(line); } return field; }
/// <summary> /// Adds the lines as doc comment to an event. /// </summary> /// <param name="event">The event.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same event.</returns> public static CodeMemberEvent AddCommentLines(this CodeMemberEvent @event, IEnumerable<string> lines) { foreach (var line in lines) { @event.AddComment(line); } return @event; }
/// <summary> /// Adds text as doc comment to a namespace. /// </summary> /// <param name="namespace">The namespace.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same namespace.</returns> public static CodeNamespace AddComment(this CodeNamespace @namespace, string commentText) { return @namespace.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds text as summary comment to a constructor. /// </summary> /// <param name="constructor">The constructor.</param> /// <param name="commentText">The text to be added as summary.</param> /// <returns>The same constructor.</returns> public static CodeConstructor AddSummaryComment(this CodeConstructor constructor, string commentText) { return constructor .AddComment("<summary>") .AddCommentLines(commentText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) .AddComment("</summary>"); }
/// <summary> /// Adds the lines as doc comment to a delegate. /// </summary> /// <param name="delegate">The delegate.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same delegate.</returns> public static CodeTypeDelegate AddCommentLines(this CodeTypeDelegate @delegate, IEnumerable<string> lines) { foreach (var line in lines) { @delegate.AddComment(line); } return @delegate; }
/// <summary> /// Adds the lines as doc comment to a type constructor. /// </summary> /// <param name="typeConstructor">The type constructor.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same type constructor.</returns> public static CodeTypeConstructor AddCommentLines(this CodeTypeConstructor typeConstructor, IEnumerable<string> lines) { foreach (var line in lines) { typeConstructor.AddComment(line); } return typeConstructor; }
/// <summary> /// Adds text as doc comment to a method. /// </summary> /// <param name="method">The method.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same method.</returns> public static CodeMemberMethod AddComment(this CodeMemberMethod method, string commentText) { return method.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds text as doc comment to a field. /// </summary> /// <param name="field">The field.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same field.</returns> public static CodeMemberField AddComment(this CodeMemberField field, string commentText) { return field.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds text as doc comment to an event. /// </summary> /// <param name="event">The event.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same event.</returns> public static CodeMemberEvent AddComment(this CodeMemberEvent @event, string commentText) { return @event.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds text as summary comment to a namespace. /// </summary> /// <param name="namespace">The namespace.</param> /// <param name="commentText">The text to be added as summary.</param> /// <returns>The same namespace.</returns> public static CodeNamespace AddSummaryComment(this CodeNamespace @namespace, string commentText) { return @namespace .AddComment("<summary>") .AddCommentLines(commentText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) .AddComment("</summary>"); }
/// <summary> /// Adds text as summary comment to a delegate. /// </summary> /// <param name="delegate">The delegate.</param> /// <param name="commentText">The text to be added as summary.</param> /// <returns>The same delegate.</returns> public static CodeTypeDelegate AddSummaryComment(this CodeTypeDelegate @delegate, string commentText) { return @delegate .AddComment("<summary>") .AddCommentLines(commentText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) .AddComment("</summary>"); }
/// <summary> /// Adds text as summary comment to a property. /// </summary> /// <param name="property">The property.</param> /// <param name="commentText">The text to be added as summary.</param> /// <returns>The same method.</returns> public static CodeMemberProperty AddSummaryComment(this CodeMemberProperty property, string commentText) { return property .AddComment("<summary>") .AddCommentLines(commentText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) .AddComment("</summary>"); }
/// <summary> /// Adds the lines as doc comment to a method. /// </summary> /// <param name="method">The method.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same method.</returns> public static CodeMemberMethod AddCommentLines(this CodeMemberMethod method, IEnumerable<string> lines) { foreach (var line in lines) { method.AddComment(line); } return method; }
/// <summary> /// Adds the lines as doc comment to a property. /// </summary> /// <param name="property">The property.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same property.</returns> public static CodeMemberProperty AddCommentLines(this CodeMemberProperty property, IEnumerable<string> lines) { foreach (var line in lines) { property.AddComment(line); } return property; }
/// <summary> /// Adds text as doc comment to a property. /// </summary> /// <param name="property">The property.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same property.</returns> public static CodeMemberProperty AddComment(this CodeMemberProperty property, string commentText) { return property.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds the lines as doc comment to a type. /// </summary> /// <param name="type">The type.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same type.</returns> public static CodeTypeDeclaration AddCommentLines(this CodeTypeDeclaration type, IEnumerable<string> lines) { foreach (var line in lines) { type.AddComment(line); } return type; }
/// <summary> /// Adds text as doc comment to a type constructor. /// </summary> /// <param name="typeConstructor">The type constructor.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same type constructor.</returns> public static CodeTypeConstructor AddComment(this CodeTypeConstructor typeConstructor, string commentText) { return typeConstructor.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds the lines as doc comment to a namespace. /// </summary> /// <param name="namespace">The namespace.</param> /// <param name="lines">The lines to be added as doc comment.</param> /// <returns>The same namespace.</returns> public static CodeNamespace AddCommentLines(this CodeNamespace @namespace, IEnumerable<string> lines) { foreach (var line in lines) { @namespace.AddComment(line); } return @namespace; }
/// <summary> /// Adds text as doc comment to a method. /// </summary> /// <param name="type">The method.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same type.</returns> public static CodeTypeDeclaration AddComment(this CodeTypeDeclaration type, string commentText) { return type.AddComment(commentText.CommentStatementForDoc()); }
/// <summary> /// Adds text as doc comment to a delegate. /// </summary> /// <param name="delegate">The delegate.</param> /// <param name="commentText">The text to be added as doc comment.</param> /// <returns>The same delegate.</returns> public static CodeTypeDelegate AddComment(this CodeTypeDelegate @delegate, string commentText) { return @delegate.AddComment(commentText.CommentStatementForDoc()); }
public static IHtmlComment Add( this IHtmlContainer container, XComment comment ) { return container.AddComment( comment.Value ); }