Exemplo n.º 1
0
        public void GenerateCodeFromMember(CodeMember member, TextWriter writer, CodeGeneratorOptions codeGeneratorOptions)
        {
            this.writer = new IndentingTextWriter(writer);
            var memberWriter = new CSharpTypeWriter(null, this.writer);

            member.Accept(memberWriter);
        }
Exemplo n.º 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("]");
     }
 }
Exemplo n.º 3
0
 private void AddMemberWithComments(CodeMember c)
 {
     c.Comments.AddRange(Scope.OfType <CodeCommentStatement>());
     Scope.RemoveAll(s => s is CodeCommentStatement);
     CurrentType.Members.Add(c);
 }