forked from dxmi/XAF_Non-Persistent-Objects-Filtering-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
59 lines (57 loc) · 2.68 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Configuration;
using System.Windows.Forms;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Security;
using DevExpress.ExpressApp.Win;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.XtraEditors;
namespace NonPersistentObjectsDemo.Win {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
#if EASYTEST
DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
WindowsFormsSettings.LoadApplicationSettings();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
DevExpress.Utils.ToolTipController.DefaultController.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;
DevExpress.ExpressApp.BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = true;
EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
if(Tracing.GetFileLocationFromSettings() == DevExpress.Persistent.Base.FileLocation.CurrentUserApplicationDataFolder) {
Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath;
}
Tracing.Initialize();
NonPersistentObjectsDemoWindowsFormsApplication winApplication = new NonPersistentObjectsDemoWindowsFormsApplication();
//SecurityStrategy security = (SecurityStrategy)winApplication.Security;
//security.RegisterXPOAdapterProviders();
if(ConfigurationManager.ConnectionStrings["ConnectionString"] != null) {
winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
}
#if EASYTEST
if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) {
winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
}
#endif
winApplication.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString;
#if DEBUG
if(System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema) {
winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
}
#endif
try {
winApplication.Setup();
winApplication.Start();
}
catch(Exception e) {
winApplication.StopSplash();
winApplication.HandleException(e);
}
}
}
}