Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 5
0
 public static ICodeScope EmptyLine(this ICodeScope self)
 {
     self.Codes.Add(new EmptyLineCode());
     return(self);
 }
Exemplo n.º 6
0
 public static ICodeScope Using(this ICodeScope self, string ns)
 {
     self.Codes.Add(new UsingCode(ns));
     return(self);
 }
Exemplo n.º 7
0
 internal void SetRoot(Guid chainID, ICodeScope root)
 {
     _root    = root;
     _chainID = chainID;
 }
Exemplo n.º 8
0
 public static ICodeScope Custom(this ICodeScope self, string line)
 {
     self.Codes.Add(new CustomCode(line));
     return(self);
 }