Пример #1
0
        internal void GenerateCodeFromMember(CodeMember member, TextWriter writer, CodeGeneratorOptions codeGeneratorOptions)
        {
            this.writer = new IndentingTextWriter(writer);
            var memberWriter = new CSharpTypeWriter(null, this.writer);

            member.Accept(memberWriter);
        }
Пример #2
0
 private void RenderCustomAttributes(CodeMember member)
 {
     foreach (var attr in member.CustomAttributes)
     {
         writer.Write("[");
         writer.Write(attr.AttributeType.TypeName);
         if (attr.Arguments.Count > 0)
         {
             writer.Write("(");
             var sep = "";
             foreach (var arg in attr.Arguments)
             {
                 writer.Write(sep);
                 sep = ",";
                 WriteAttrArgument(arg);
             }
             writer.Write(")");
         }
         writer.WriteLine("]");
     }
 }
Пример #3
0
 private void AddMemberWithComments(CodeMember c)
 {
     c.Comments.AddRange(Scope.OfType <CodeCommentStatement>());
     Scope.RemoveAll(s => s is CodeCommentStatement);
     CurrentType.Members.Add(c);
 }