public override void WriteCode(StringBuilder sb)
 {
     if (create)
         sb.IndentedLines("internal new static " + typeName + " " + name + " = new " + typeName + "();");
     else
         sb.IndentedLines("internal new static " + typeName + " " + name + ";");
 }
 public virtual void WriteCode(StringBuilder sb)
 {
     if (create)
         sb.IndentedLines("internal " + typeName + " " + name + " = new " + typeName + "();");
     else
         sb.IndentedLines("internal " + typeName + " " + name + ";");
 }
 public void WriteCode(StringBuilder sb)
 {
     Indenter.tabs = 2;
     sb.IndentedLines(header);
     sb.IndentedLines("{");
     Indenter.tabs = 3;
     foreach (var line in body)
         sb.IndentedLines(line);
     Indenter.tabs = 2;
     sb.IndentedLines("}");
 }
 public void WriteCode(StringBuilder sb)
 {
     Indenter.tabs = 0;
     foreach (var us in usingStatements)
         sb.IndentedLines(us);
     sb.AppendLine("");
     foreach (var ns in namespaces)
         ns.WriteCode(sb);
 }
 public void WriteCode(StringBuilder sb)
 {
     Indenter.tabs = 0;
     sb.AppendLine("namespace " + name);
     sb.AppendLine("{");
     foreach (var hc in helperClasses)
     {
         hc.WriteCode(sb);
         sb.AppendLine("");
     }
     mainClass.WriteCode(sb);
     Indenter.tabs = 0;
     sb.IndentedLines("}");
 }
 public void WriteCode(StringBuilder sb)
 {
     Indenter.tabs = 1;
     string modifiers = "public ";
     if (isPartial) modifiers += "partial ";
     if (baseClass != null && baseClass.Length > 0)
         sb.IndentedLines(modifiers + "class " + name + " : " + baseClass);
     else
         sb.IndentedLines(modifiers + "class " + name);
     sb.IndentedLines("{");
     Indenter.tabs = 2;
     if (memberVars.Count > 0)
     {
         sb.IndentedLines("// Member variables");
         foreach (var mem in memberVars)
             mem.WriteCode(sb);
         sb.AppendLine("");
     }
     if (definitions.Count > 0)
     {
         sb.IndentedLines("// Custom code");
         foreach (var df in definitions)
             sb.IndentedLines(df);
         sb.AppendLine("");
     }
     sb.IndentedLines("// Constructor");
     if (constructor != null) constructor.WriteCode(sb);
     sb.AppendLine("");
     if (staticRef != null)
     {
         sb.IndentedLines("// SetStaticReferences");
         staticRef.WriteCode(sb);
         sb.AppendLine("");
     }
     if (createNamed != null)
     {
         sb.IndentedLines("// CreateNamedComponents");
         createNamed.WriteCode(sb);
         sb.AppendLine("");
     }
     if (init != null)
     {
         sb.IndentedLines("// InitializeComponents");
         init.WriteCode(sb);
         sb.AppendLine("");
     }
     if (restore != null)
     {
         sb.IndentedLines("// RestoreComponents");
         restore.WriteCode(sb);
         sb.AppendLine("");
     }
     sb.IndentedLines("// Methods");
     foreach (var met in methods)
     {
         met.WriteCode(sb);
         if (!object.ReferenceEquals(met, methods.Last())) sb.AppendLine("");
     }
     Indenter.tabs = 1;
     sb.IndentedLines("}");
 }