public object CreateApplication()
        {
            GLWindowsFormsApplication winApplication = new GLWindowsFormsApplication();

            winApplication.SetupLocalPath("");
            winApplication.ConnectionString = SiteCache.Instance.ConnectionString;
            return(winApplication);
        }
Example #2
0
        public static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;


            GLWindowsFormsApplication winApplication = new GLWindowsFormsApplication();

            winApplication.SetupLocalPath("");
            winApplication.ConnectionString = SiteCache.Instance.ConnectionString;

            Tracing.LogName = Path.Combine(SiteCache.Instance.LocalPath, HandyDefaults.APP_NAME, "logs", "eXpressAppFramework");

            if (!Directory.Exists(Path.GetDirectoryName(Tracing.LogName)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(Tracing.LogName));
            }


            Tracing.Initialize();



#if EASYTEST
            if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null)
            {
                winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
#endif
            try {
                // access db so it is created here.
                HandyDataFunctions.EnsureDatabaseIsCreated();


                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }