Exemplo n.º 1
0
        static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Database.SetInitializer <ShellDbContext>(null);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
            ShellWindowsFormsApplication winApplication = new ShellWindowsFormsApplication();
            // Refer to the http://documentation.devexpress.com/#Xaf/CustomDocument2680 help article for more details on how to provide a custom splash form.
            //winApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen("YourSplashImage.png");
            if (ConfigurationManager.ConnectionStrings["Default"] != null)
            {
                winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
            }
#if EASYTEST
            if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null)
            {
                winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif
            try {
                ConfigSecurity(winApplication);

                winApplication.Setup();
                EntityBase.SetApplication(winApplication);
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Database.SetInitializer <ShellDbContext>(null);
            //ModelMemberReadOnlyCalculator.AllowPersistentCustomProperties = true;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
            ShellWindowsFormsApplication winApplication = new ShellWindowsFormsApplication();

            winApplication.Modules.FindModule <WorkflowWindowsFormsModule>().QueryAvailableActivities +=
                delegate(object sender, ActivitiesInformationEventArgs e)
            {
                foreach (var tralusModule in winApplication.Modules.OfType <TralusModule>())
                {
                    var activityTypes = tralusModule.GetWorkflowActivityTypes();

                    // ToDo: I should read category and name from attributes.
                    foreach (var activityType in activityTypes)
                    {
                        if (e.ActivitiesInformation.All(ai => ai.ActivityType != activityType))
                        {
                            e.ActivitiesInformation.Add(new ActivityInformation(activityType,
                                                                                "Tralus Activities",
                                                                                activityType.Name
                                                                                //,ImageLoader.Instance.GetImageInfo("CreateTask").Image
                                                                                ));
                        }
                    }
                }
            };

            // Refer to the http://documentation.devexpress.com/#Xaf/CustomDocument2680 help article for more details on how to provide a custom splash form.
            //winApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen("YourSplashImage.png");

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

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