public void WriteHeader(IndentStreamWriter writer) { if (this._fullUsings.Count == 0) { writer.WriteLine("using System;"); } else { foreach (var @using in this._fullUsings.OrderBy(key => key)) { writer.WriteLine("using {0};", @using); } } writer.WriteLine(); writer.WriteLine("namespace {0}", this._namespace ?? this.Namespace); writer.WriteOpenBrace(); foreach (var @using in this._shortUsings.OrderBy(key => key)) { writer.WriteLineIndent("using {0};", @using); } writer.WriteLine(); writer.WriteIndent("public partial class {0}", this.ClassName); if (this._base != null) { writer.Write(" : {0}", this._base); } if (this._implements.Count != 0) { writer.Write(this._base == null ? " : {0}" : ", {0}", String.Join(", ", this._implements)); } writer.WriteLine(); writer.WriteOpenBrace(); }