public static ICodeScope Class(this ICodeScope self, string className, string parentClassName, bool isPartial, bool isStatic, Action <ClassCodeScope> classCodeScopeSetting) { var classCodeScope = new ClassCodeScope(className, parentClassName, isPartial, isStatic); classCodeScopeSetting(classCodeScope); self.Codes.Add(classCodeScope); return(self); }
public static ICodeScope CustomScope(this ICodeScope self, string firstLine, bool semicolon, Action <CustomCodeScope> customCodeScopeSetting) { var custom = new CustomCodeScope(firstLine); custom.Semicolon = semicolon; customCodeScopeSetting(custom); self.Codes.Add(custom); return(self); }
public static ICodeScope Namespace(this ICodeScope self, string ns, Action <NamespaceCodeScope> namespaceCodeScopeSetting) { var namespaceCodeScope = new NamespaceCodeScope(ns); namespaceCodeScopeSetting(namespaceCodeScope); self.Codes.Add(namespaceCodeScope); return(self); }
public static ICodeScope GetCurrentScope() { lock (_lockObject) { ICodeScope root = Instance.GetCurrentRoot(); if (root == null) { return(null); } var scope = root; while (scope.NextNode != null) { scope = scope.NextNode; } return(scope); } }
public static ICodeScope EmptyLine(this ICodeScope self) { self.Codes.Add(new EmptyLineCode()); return(self); }
public static ICodeScope Using(this ICodeScope self, string ns) { self.Codes.Add(new UsingCode(ns)); return(self); }
internal void SetRoot(Guid chainID, ICodeScope root) { _root = root; _chainID = chainID; }
public static ICodeScope Custom(this ICodeScope self, string line) { self.Codes.Add(new CustomCode(line)); return(self); }