Example #1
0
        public void Generate(CodeGenerator generator, CodeStatementEmitOptions emitOptions)
        {
            generator.EnterElement(this);

            StartDirectives.Generate(generator);
            GenerateInner(generator, emitOptions);
            EndDirectives.Generate(generator);

            generator.ExitElement();
        }
Example #2
0
        public void Generate(CodeGenerator generator, string name, CodeBasicPropertyMember property, CodeCompositeTypeDeclaration enclosingType)
        {
            generator.EnterElement(this);

            StartDirectives.Generate(generator);
            Comments.Generate(generator);
            Modifiers.Generate(generator);
            GenerateInner(generator, name, property, enclosingType);
            EndDirectives.Generate(generator);

            generator.ExitElement();
        }
        public void Generate(CodeGenerator generator, CodeCompositeTypeDeclaration enclosingType)
        {
            generator.EnterElement(this);

            StartDirectives.Generate(generator);
            Comments.Generate(generator);
            generator.GenerateAttributes(CustomAttributes);
            GenerateInner(generator, enclosingType);
            EndDirectives.Generate(generator);

            generator.ExitElement();
        }
Example #4
0
        public void Generate(CodeGenerator generator)
        {
            generator.EnterElement(this);

            generator.WriteLine(TokenType.Comment, @"//--------------------------------------------------------------");
            generator.WriteLine(TokenType.Comment, @"//              _______      _____      __       ________       ");
            generator.WriteLine(TokenType.Comment, @"//             |  ___  \    /     \    |  |     |___  ___|      ");
            generator.WriteLine(TokenType.Comment, @"//             | |   \  |  /  ___  \   |  |         / /         ");
            generator.WriteLine(TokenType.Comment, @"//             | |___/ /  /  /   \  \  |  |        / /_         ");
            generator.WriteLine(TokenType.Comment, @"//             | |   \ \  \  \___/  /  |  |       /_  /         ");
            generator.WriteLine(TokenType.Comment, @"//             | |___/  |  \       /   |  |____    | /          ");
            generator.WriteLine(TokenType.Comment, @"//             |_______/    \_____/    |_______|   |/           ");
            generator.WriteLine(TokenType.Comment, @"//                                                              ");
            generator.WriteLine(TokenType.Comment, @"//                 V I S U A L    S C R I P T I N G             ");
            generator.WriteLine(TokenType.Comment, @"//--------------------------------------------------------------");
            generator.WriteLine(TokenType.Comment, @"//                                                              ");
            generator.WriteLine(TokenType.Comment, @"// THIS FILE IS AUTO-GENERATED.                                 ");
            generator.WriteLine(TokenType.Comment, @"//                                                              ");
            generator.WriteLine(TokenType.Comment, @"// ANY CHANGES WILL BE LOST NEXT TIME THIS SCRIPT IS GENERATED. ");
            generator.WriteLine(TokenType.Comment, @"//                                                              ");
            generator.WriteLine(TokenType.Comment, @"//--------------------------------------------------------------");

            StartDirectives.Generate(generator);
            if (StartDirectives.Count > 0)
            {
                generator.WriteLine();
            }

            Usings.Generate(generator);

            if (AssemblyCustomAttributes.Count > 0)
            {
                generator.GenerateAttributes(AssemblyCustomAttributes, "assembly");
                generator.WriteLine();
            }

            generator.PushUsingSet(Usings);
            Namespaces.Generate(generator);
            generator.PopUsingSet();

            if (EndDirectives.Count > 0)
            {
                generator.WriteLine();
            }
            EndDirectives.Generate(generator);

            generator.ExitElement();
        }
Example #5
0
        public void Generate(CodeGenerator generator)
        {
            generator.EnterElement(this);

            StartDirectives.Generate(generator);
            Comments.Generate(generator);

            generator.GenerateAttributes(CustomAttributes);
            generator.OutputIdentifier(TokenType.Identifier, Name);
            if (Initializer != null)
            {
                generator.Write(TokenType.Space, ' ');
                generator.Write(TokenType.Punctuation, '=');
                generator.Write(TokenType.Space, ' ');
                Initializer.Generate(generator);
            }
            generator.WriteLine(TokenType.Punctuation, ',');

            EndDirectives.Generate(generator);

            generator.ExitElement();
        }