public static void Main(string[] arguments) { MainDemoWinApplication winApplication = new MainDemoWinApplication(); #if DEBUG DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register(); #endif AuditTrailService.Instance.QueryCurrentUserName += new QueryCurrentUserNameEventHandler(Instance_QueryCurrentUserName); winApplication.CustomizeFormattingCulture += new EventHandler<CustomizeFormattingCultureEventArgs>(winApplication_CustomizeFormattingCulture); winApplication.LastLogonParametersReading += new EventHandler<LastLogonParametersReadingEventArgs>(winApplication_LastLogonParametersReading); winApplication.CreateCustomModelDifferenceStore += new EventHandler<CreateCustomModelDifferenceStoreEventArgs>(winApplication_CreateCustomModelDifferenceStore); winApplication.CreateCustomObjectSpaceProvider += (sender, e) => { e.ObjectSpaceProvider = new SecuredObjectSpaceProvider((ISelectDataSecurityProvider)winApplication.Security, e.ConnectionString, e.Connection, false); }; ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["ConnectionString"]; if(connectionStringSettings != null) { winApplication.ConnectionString = connectionStringSettings.ConnectionString; } else if(string.IsNullOrEmpty(winApplication.ConnectionString) && winApplication.Connection == null) { connectionStringSettings = ConfigurationManager.ConnectionStrings["SqlExpressConnectionString"]; if(connectionStringSettings != null) { winApplication.ConnectionString = DbEngineDetector.PatchConnectionString(connectionStringSettings.ConnectionString); } } try { winApplication.Setup(); winApplication.Start(); } catch(Exception e) { winApplication.HandleException(e); } }
public static void Main(string[] arguments) { MainDemoWinApplication winApplication = new MainDemoWinApplication(); #if DEBUG DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register(); #endif winApplication.CustomizeFormattingCulture += new EventHandler<CustomizeFormattingCultureEventArgs>(winApplication_CustomizeFormattingCulture); try { AuditTrailService.Instance.QueryCurrentUserName += new QueryCurrentUserNameEventHandler(Instance_QueryCurrentUserName); winApplication.LastLogonParametersReading += new EventHandler<LastLogonParametersReadingEventArgs>(winApplication_LastLogonParametersReading); winApplication.CreateCustomModelDifferenceStore += new EventHandler<CreateCustomModelDifferenceStoreEventArgs>(winApplication_CreateCustomModelDifferenceStore); if(ConfigurationManager.ConnectionStrings["ConnectionString"] != null) { winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; } winApplication.CreateCustomObjectSpaceProvider += delegate(object sender, CreateCustomObjectSpaceProviderEventArgs e) { e.ObjectSpaceProvider = new SecuredObjectSpaceProvider((ISelectDataSecurityProvider)winApplication.Security, e.ConnectionString, e.Connection); }; winApplication.Setup(); winApplication.Start(); } catch(Exception e) { winApplication.HandleException(e); } }