Пример #1
0
 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 + ";");
 }
Пример #2
0
 public virtual void WriteCode(StringBuilder sb)
 {
     if (create)
         sb.IndentedLines("internal " + typeName + " " + name + " = new " + typeName + "();");
     else
         sb.IndentedLines("internal " + typeName + " " + name + ";");
 }
Пример #3
0
 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("}");
 }
Пример #4
0
 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);
 }
Пример #5
0
 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("}");
 }
Пример #6
0
 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("}");
 }