protected ClassOrStructDeclaration() { Implements = new List <TypeReference>(); Parameters = new CodeObjectCollection <TypeParameter>(this); Members = new CodeObjectCollection <MemberDeclaration>(this); Types = new CodeObjectCollection <TypeDeclaration>(this); }
public StructDeclaration(string?name) { Name = name; Implements = new List <TypeReference>(); Parameters = new CodeObjectCollection <TypeParameter>(this); Members = new CodeObjectCollection <MemberDeclaration>(this); Types = new CodeObjectCollection <TypeDeclaration>(this); }
protected virtual void Write(IndentedTextWriter writer, CodeObjectCollection <CustomAttribute> attributes) { if (attributes.Count > 0) { Write(writer, attributes, writer.NewLine); writer.WriteLine(); } }
private void WriteGenericParameters(IndentedTextWriter writer, CodeObjectCollection <TypeReference> types) { if (types.Any()) { writer.Write("<"); Write(writer, types, ", "); writer.Write(">"); } }
private void VisitCollection <T>(CodeObjectCollection <T> items) where T : CodeObject { if (items == null) { return; } foreach (var item in items) { Visit(item); } }
public MethodInvokeExpression(Expression?method, TypeReference[]?parameters, params Expression[] arguments) { Parameters = new List <TypeReference>(); Arguments = new CodeObjectCollection <Expression>(this); Method = method; Arguments.AddRange(arguments); if (parameters != null) { foreach (var parameter in parameters) { Parameters.Add(parameter); } } }
protected ConstructorInitializer(IEnumerable <Expression>?codeExpressions) { CommentsBefore = new CommentCollection(this); CommentsAfter = new CommentCollection(this); Arguments = new CodeObjectCollection <Expression>(this); if (codeExpressions != null) { foreach (var codeExpression in codeExpressions) { Arguments.Add(codeExpression); } } }
public virtual void VisitExpressions(CodeObjectCollection <Expression> expressions) { VisitCollection(expressions); }
protected virtual void Write(IndentedTextWriter writer, CodeObjectCollection <MethodArgumentDeclaration> args) { Write(writer, args, ", "); }