<commit_before>using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Web.Configuration;
using System.Web;

using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.ExpressApp.Security;
using DevExpress.ExpressApp.Web;
using DevExpress.Web;
using Tralus.Framework.BusinessModel.Entities;
using Tralus.Shell.Module.Security;
using Tralus.Shell.Web.Security;
using ReflectionHelper = Tralus.Shell.Module.Utility.ReflectionHelper;

namespace Tralus.Shell.Web
{
    public class Global : System.Web.HttpApplication
    {
        public static IEnumerable<Type> LoadedModuleTypes;
        public static IEnumerable<Type> LoadedContextTypes;

        static Global()
        {
            if (ConfigurationManager.AppSettings["ApplicationStyle"] == "New")
                WebApplication.Instance.SwitchToNewStyle();

            try
            {
                AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
                {
                    var location = Path.Combine(AppDomain.CurrentDomain.RelativeSearchPath,
                        args.Name.Split(',')[0] + ".dll");
                    if (File.Exists(location))
                    {
                        var assembly = Assembly.LoadFrom(location);
                        return assembly;
                    }
                    return null;
                };

                ReflectionHelper.GetImportedModules(out LoadedModuleTypes, out LoadedContextTypes);
                //foreach (var loadedModuleType in LoadedModuleTypes)
                //{
                //    var loadedModule = (ModuleBase)Activator.CreateInstance(loadedModuleType);
                //    Modules.Insert(0, loadedModule);
                //}
            }
            catch (Exception exception)
            {
                Trace.WriteLine($"Unable to load modules: {exception}");
            }
        }

        public Global()
        {
            InitializeComponent();

           

        }
        protected void Application_Start(Object sender, EventArgs e)
        {
            ASPxWebControl.CallbackError += new EventHandler(Application_Error);
#if EASYTEST
            DevExpress.ExpressApp.Web.TestScripts.TestScriptsManager.EasyTestEnabled = true;
#endif
        }
        protected void Session_Start(Object sender, EventArgs e)
        {
            var webApplication = new ShellAspNetApplication();
            ConfigSecurity(webApplication);

            WebApplication.SetInstance(Session, webApplication);



            if (ConfigurationManager.ConnectionStrings["Default"] != null)
            {
                WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
            }
#if EASYTEST
            if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) {
                WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif

            //WebApplication.Instance.Security = new TralusSecurityStrategy(new AdfsAuthentication());
            WebApplication.Instance.Setup();
            WebApplication.Instance.Start();
        }
<commit_msg>Application NewStyle should be apply on non static constructor of Global<commit_after>using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Web.Configuration;
using System.Web;

using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.ExpressApp.Security;
using DevExpress.ExpressApp.Web;
using DevExpress.Web;
using Tralus.Framework.BusinessModel.Entities;
using Tralus.Shell.Module.Security;
using Tralus.Shell.Web.Security;
using ReflectionHelper = Tralus.Shell.Module.Utility.ReflectionHelper;

namespace Tralus.Shell.Web
{
    public class Global : System.Web.HttpApplication
    {
        public static IEnumerable<Type> LoadedModuleTypes;
        public static IEnumerable<Type> LoadedContextTypes;

        static Global()
        {
            

            try
            {
                AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
                {
                    var location = Path.Combine(AppDomain.CurrentDomain.RelativeSearchPath,
                        args.Name.Split(',')[0] + ".dll");
                    if (File.Exists(location))
                    {
                        var assembly = Assembly.LoadFrom(location);
                        return assembly;
                    }
                    return null;
                };

                ReflectionHelper.GetImportedModules(out LoadedModuleTypes, out LoadedContextTypes);
                //foreach (var loadedModuleType in LoadedModuleTypes)
                //{
                //    var loadedModule = (ModuleBase)Activator.CreateInstance(loadedModuleType);
                //    Modules.Insert(0, loadedModule);
                //}
            }
            catch (Exception exception)
            {
                Trace.WriteLine($"Unable to load modules: {exception}");
            }
        }

        public Global()
        {
            InitializeComponent();

           

        }
        protected void Application_Start(Object sender, EventArgs e)
        {
            ASPxWebControl.CallbackError += new EventHandler(Application_Error);
#if EASYTEST
            DevExpress.ExpressApp.Web.TestScripts.TestScriptsManager.EasyTestEnabled = true;
#endif
        }
        protected void Session_Start(Object sender, EventArgs e)
        {
            var webApplication = new ShellAspNetApplication();
            ConfigSecurity(webApplication);

            WebApplication.SetInstance(Session, webApplication);

            if (ConfigurationManager.AppSettings["ApplicationStyle"] == "New")
                WebApplication.Instance.SwitchToNewStyle();

            if (ConfigurationManager.ConnectionStrings["Default"] != null)
            {
                WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
            }
#if EASYTEST
            if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) {
                WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif

            //WebApplication.Instance.Security = new TralusSecurityStrategy(new AdfsAuthentication());
            WebApplication.Instance.Setup();
            WebApplication.Instance.Start();
        }

{'fraction_non_alphanumeric': 0.08480355819125278, 'fraction_numerical': 0.0005930318754633062, 'mean_word_length': 2.162681669010783, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2129911', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1525, 'n_words': 296}