예제 #1
0
 public CodeBlockSet(ICodeBlock pParent, string pPre)
     : base(pParent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings(pPre, "set")));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #2
0
 public CodeBlockEnum(ICodeBlock pParent, string pPre, string pName)
     : base(pParent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings(pPre, "enum", pName)));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #3
0
 public CodeBlockNamespace(ICodeBlock pParent, string value) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine("namespace " + (string.IsNullOrEmpty(value) ? "" : value)));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
     this.TabCount = 0;
 }
 public CodeBlockDoWhile(ICodeBlock pParent, string pCondition)
     : base(pParent)
 {
     PreCodeLines.Add(new CodeLine("do"));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
     PostCodeLines.Add(new CodeLine("while (" + (string.IsNullOrEmpty(pCondition) ? "" : pCondition) + ")"));
 }
예제 #5
0
        public CodeBlockFunction(ICodeBlock parent, string pre, string name, string parameters, string whereClause = null) : base(parent)
        {
            string functionSignature = StringHelper.SpaceStrings(pre, name, "(") + (string.IsNullOrEmpty(parameters) ? "" : parameters) + ")" + " " + whereClause;

            PreCodeLines.Add(new CodeLine(functionSignature));
            PreCodeLines.Add(new CodeLine("{"));
            PostCodeLines.Add(new CodeLine("}"));
        }
예제 #6
0
 public CodeBlockBlock(ICodeBlock pParent) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #7
0
 public CodeBlockSwitch(ICodeBlock parent, string condition) : base(parent)
 {
     PreCodeLines.Add(new CodeLine("switch(" + condition + ")"));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #8
0
 public CodeBlockDefault(ICodeBlock parent)
     : base(parent)
 {
     PreCodeLines.Add(new CodeLine("default:"));
     PostBodyCodeLines.Add(new CodeLine("break;"));
 }
예제 #9
0
 public CodeBlockCaseNoBreak(ICodeBlock parent, string condition)
     : base(parent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings("case ", condition) + ":"));
 }
예제 #10
0
 public CodeBlockElseIf(ICodeBlock pParent, string pCondition) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine("else if (" + (string.IsNullOrEmpty(pCondition) ? "" : pCondition) + ")"));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #11
0
 public CodeBlockAutoProperty(ICodeBlock pParent, string pPre, string pName, string pGetPre, string pSetPre) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings(pPre, pName, "{", pGetPre, "get;", pSetPre, "set;", "}")));
 }
예제 #12
0
 public CodeBlockAutoSet(ICodeBlock pParent) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine("set;"));
 }
예제 #13
0
 public CodeBlockInterface(ICodeBlock pParent, string pPre, string pName, string pPost) : base(pParent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings(pPre, "interface", pName, pPost)));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }
예제 #14
0
 public CodeBlockFunction(ICodeBlock parent, string pre, string name, string parameters) : base(parent)
 {
     PreCodeLines.Add(new CodeLine(StringHelper.SpaceStrings(pre, name, "(") + (string.IsNullOrEmpty(parameters) ? "" : parameters) + ")"));
     PreCodeLines.Add(new CodeLine("{"));
     PostCodeLines.Add(new CodeLine("}"));
 }