public override void Generate(CSourceWriter sw) { CSharpProject.WriteVisibility(sw, this.Visibility); sw.Space(); if (this.IsStatic) { sw.Write("static"); sw.Space(); } if (this.IsOverride) { sw.Write("override"); sw.Space(); } this.Type.Generate(sw); sw.Space(); sw.Write(this.Name); sw.Write("("); bool Primero = true; foreach (CParam p in this.lParam) { sw.WriteComma(ref Primero); p.Generate(sw); } sw.Write(")"); sw.WriteLn("{"); sw.AddTab(); foreach (CSentence sen in lSentence) { sen.Generate(sw); } sw.DelTab(); sw.WriteLn("}"); }
public override void Generate(CSourceWriter sw) { CSharpProject.WriteVisibility(sw, this.Visibility); sw.Space(); if (this.Class == null) { throw new NullReferenceException("El constructor ha de tener una clase."); } sw.Write(this.Class.Name); sw.Write("("); bool Primero = true; foreach (CParam p in this.lParam) { sw.WriteComma(ref Primero); p.Generate(sw); } sw.Write(")"); sw.OpenBracesLn(); sw.AddTab(); foreach (CSentence sen in lSentence) { sen.Generate(sw); } sw.DelTab(); sw.CloseBracesLn(); }
public override void Generate(CSourceWriter sw) { CSharpProject.WriteVisibility(sw, this.CSharpVisibility); sw.Space(); if (this.IsStatic) { sw.Write("static"); sw.Space(); } if (this.IsPartial) { sw.Write("partial"); sw.Space(); } sw.Write("class"); sw.Space(); sw.Write(this.Name); if (!string.IsNullOrWhiteSpace(this.ParentClassName)) { sw.Write(" : "); sw.Write(this.ParentClassName); } //*** Interfaces sw.OpenBracesLn(); sw.AddTab(); foreach (CClassElement item in this.lElement) { item.Generate(sw); } sw.DelTab(); sw.CloseBracesLn(); }
public override void Generate(CSourceWriter sw) { CSharpProject.WriteVisibility(sw, this.CSharpVisibility); sw.Space(); if (this.IsStatic) { sw.Write("static"); sw.Space(); } this.Type.Generate(sw); sw.Space(); sw.Write(this.Name); if (!string.IsNullOrWhiteSpace(this.InitialValue)) { sw.Write(" = "); sw.Write(this.InitialValue); } sw.SemicolonLn(); }
public override void Generate(CSourceWriter sw) { CSharpProject.WriteVisibility(sw, this.Visibility); sw.Space(); if (this.Override) { sw.Write("override"); sw.Space(); } this.Type.Generate(sw); sw.Space(); sw.Write(this.Name); sw.OpenBracesLn(); sw.AddTab(); if (this.HasGet) { if (this.Visibility != this.GetVisibility) { CSharpProject.WriteVisibility(sw, this.GetVisibility); sw.Space(); } sw.Write("get"); if (this.lSentenceGet.Count > 0) { sw.OpenBracesLn(); sw.AddTab(); foreach (CSentence s in this.lSentenceGet) { s.Generate(sw); } sw.DelTab(); sw.CloseBracesLn(); } else { sw.SemicolonLn(); } } if (this.HasSet) { if (this.Visibility != this.SetVisibility) { CSharpProject.WriteVisibility(sw, this.SetVisibility); sw.Space(); } sw.Write("set"); if (this.lSentenceSet.Count > 0) { sw.OpenBracesLn(); sw.AddTab(); foreach (CSentence s in this.lSentenceSet) { s.Generate(sw); } sw.DelTab(); sw.CloseBracesLn(); } else { sw.SemicolonLn(); } } sw.DelTab(); sw.CloseBracesLn(); }