<commit_before>﻿using Newtonsoft.Json;
using Serenity.ComponentModel;
using Serenity.Data;
using System;
using System.Linq;
using System.Reflection;
using System.Web.Mvc;

namespace Serenity.CodeGeneration
{
    public partial class ServerImportsGenerator : ServerImportGeneratorBase
    {
        public ServerImportsGenerator(params Assembly[] assemblies)
            : base(assemblies)
        {
        }

        private string[] UsingNamespaces = new string[]
        {
            "jQueryApi",
            "Serenity",
            "Serenity.ComponentModel",
            "System",
            "System.Collections",
            "System.Collections.Generic",
            "System.ComponentModel",
            "System.Runtime.CompilerServices"
        };

        protected override bool IsTS()
        {
            return false;
        }

        protected override bool IsUsingNamespace(string ns)
        {
            return UsingNamespaces.Contains(ns);
        }

        protected override void GenerateAll()
        {
            base.GenerateAll();
        }

        protected override void GenerateCodeFor(Type type)
        {
            var codeNamespace = GetNamespace(type);

            AppendUsings(UsingNamespaces);
            sb.AppendLine();

            cw.Indented("namespace ");
            sb.AppendLine(codeNamespace);

            cw.InBrace(delegate
            {
                if (type.IsEnum)
                {
                    GenerateEnum(type);
                    return;
                }

                if (type.IsSubclassOf(typeof(Controller)))
                {
                    GenerateService(type);
                    return;
                }

                var formScriptAttr = type.GetCustomAttribute<FormScriptAttribute>();
                if (formScriptAttr != null)
                {
                    GenerateForm(type, formScriptAttr);
                    return;
                }

                if (type.GetCustomAttribute<ColumnsScriptAttribute>() != null)
                {
                    //GenerateColumns(type);
                    return;
                }

                cw.IndentedLine("[Imported, Serializable, PreserveMemberCase]");
                cw.Indented("public partial class ");
<commit_msg>do same for ServerImportsGenerator<commit_after>﻿using Newtonsoft.Json;
using Serenity.ComponentModel;
using Serenity.Data;
using System;
using System.Linq;
using System.Reflection;
using System.Web.Mvc;

namespace Serenity.CodeGeneration
{
    public partial class ServerImportsGenerator : ServerImportGeneratorBase
    {
        public ServerImportsGenerator(params Assembly[] assemblies)
            : base(assemblies)
        {
        }

        private string[] UsingNamespaces = new string[]
        {
            "jQueryApi",
            "Serenity",
            "Serenity.ComponentModel",
            "System",
            "System.Collections",
            "System.Collections.Generic",
            "System.ComponentModel",
            "System.Runtime.CompilerServices"
        };

        protected override bool IsTS()
        {
            return false;
        }

        protected override bool IsUsingNamespace(string ns)
        {
            return UsingNamespaces.Contains(ns);
        }

        protected override void GenerateAll()
        {
            base.GenerateAll();
        }

        protected override void GenerateCodeFor(Type type)
        {
            var codeNamespace = GetNamespace(type);

            AppendUsings(UsingNamespaces);
            sb.AppendLine();

            cw.Indented("namespace ");
            sb.AppendLine(codeNamespace);

            cw.InBrace(delegate
            {
                if (type.IsEnum)
                {
                    GenerateEnum(type);
                    return;
                }

                if (type.IsSubclassOf(typeof(Controller)))
                {
                    GenerateService(type);
                    return;
                }

                var formScriptAttr = type.GetCustomAttribute<FormScriptAttribute>();
                if (formScriptAttr != null)
                {
                    GenerateForm(type, formScriptAttr);
                    EnqueueTypeMembers(type);
                    return;
                }

                if (type.GetCustomAttribute<ColumnsScriptAttribute>() != null)
                {
                    //GenerateColumns(type);
                    EnqueueTypeMembers(type);
                    return;
                }

                cw.IndentedLine("[Imported, Serializable, PreserveMemberCase]");
                cw.Indented("public partial class ");

{'fraction_non_alphanumeric': 0.0823906083244397, 'fraction_numerical': 0.0, 'mean_word_length': 1.4254658385093169, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4824063', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1054, 'n_words': 201}