Exemplo n.º 1
0
 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);
            }
        }
Exemplo n.º 3
0
        public static void Main(string[] arguments)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (Tracing.GetFileLocationFromSettings() == FileLocation.CurrentUserApplicationDataFolder)
            {
                Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath;
            }
            Tracing.Initialize();
            MainDemoWinApplication winApplication = new MainDemoWinApplication();

            DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
#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);
            SecurityAdapterHelper.Enable();
            winApplication.CreateCustomModelDifferenceStore += new EventHandler <CreateCustomModelDifferenceStoreEventArgs>(winApplication_CreateCustomModelDifferenceStore);
            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);
                }
            }
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            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);
     }
 }