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.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();
 }
Ejemplo n.º 3
0
 private void GeneraSelectAll(CSourceWriter sw)
 {
     sw.Write("select");
     sw.Space();
     this.CamposPorComas(sw);
     sw.Space();
     sw.Write("from");
     sw.Space();
     sw.Write(this.Name);
 }
        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();
        }
 private void GenerateNamespace(CSourceWriter sw)
 {
     sw.Write("namespace");
     sw.Space();
     sw.Write(this.Namespace);
     sw.OpenBracesLn();
     sw.AddTab();
 }
Ejemplo n.º 6
0
        private void GeneraSelectByPk(CSourceWriter sw)
        {
            sw.Write("select");
            sw.Space();
            this.CamposPorComas(sw);
            sw.Space();
            sw.Write("from");
            sw.Space();
            sw.Write(this.Name);
            bool Primero = true;
            var  sb      = new StringBuilder();

            foreach (CFieldM f in this.lFieldPk)
            {
                SUtilBD.AddCondicion(ref Primero, sb, f.Name + " = @" + SUtilBD.ParamName(f.Name));
            }
            sw.Space();
            sw.Write(sb.ToString());
        }
 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 void Generate(CSourceWriter sw)
 {
     Type.Generate(sw);
     sw.Space();
     sw.Write(this.Name);
 }
 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();
 }