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.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
                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.CreateCustomObjectSpaceProvider += delegate(object sender, CreateCustomObjectSpaceProviderEventArgs e) {
                    e.ObjectSpaceProvider = new SecuredObjectSpaceProvider((ISelectDataSecurityProvider)winApplication.Security, e.ConnectionString, e.Connection);
                };

                if(ConfigurationManager.ConnectionStrings["ConnectionString"] != null) {
                    winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                }

                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);

            Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath;
            Tracing.Initialize();
            MainDemoWinApplication winApplication = new MainDemoWinApplication
            {
                EnableModelCache = true,
                LinkNewObjectToParentImmediately = false,
                UseLightStyle = 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);
            winApplication.CreateCustomObjectSpaceProvider  += (sender, e) => {
                e.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((ISelectDataSecurityProvider)winApplication.Security, e.ConnectionString, e.Connection, false));
                e.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(winApplication.TypesInfo, null));
            };
            ////winApplication.UseOldTemplates = true;
            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 DEBUG
            foreach (string argument in arguments)
            {
                if (argument.StartsWith("-connectionString:"))
                {
                    string connectionString = argument.Replace("-connectionString:", "");
                    winApplication.ConnectionString = connectionString;
                }
            }
#endif
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            try {
                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Exemplo n.º 4
0
        public static void Main(string[] arguments)
        {
            MainDemoWinApplication winApplication = new MainDemoWinApplication();

#if DEBUG
            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.CreateCustomObjectSpaceProvider  += delegate(object sender, CreateCustomObjectSpaceProviderEventArgs e) {
                    e.ObjectSpaceProvider = new SecuredObjectSpaceProvider((ISelectDataSecurityProvider)winApplication.Security, e.ConnectionString, e.Connection);
                };

                if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null)
                {
                    winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                }

                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Exemplo n.º 5
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();

#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();
            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 DEBUG
            foreach (string argument in arguments)
            {
                if (argument.StartsWith("-connectionString:"))
                {
                    string connectionString = argument.Replace("-connectionString:", "");
                    winApplication.ConnectionString = connectionString;
                }
            }
#endif
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            try {
                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Exemplo n.º 6
0
        public static void Main(string[] arguments)
        {
            MainDemoWinApplication winApplication = new MainDemoWinApplication();

#if DEBUG
            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);
                if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null)
                {
                    winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                }
                DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.Register();
                winApplication.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString;
                winApplication.Setup();
                winApplication.Start();
            } catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Exemplo n.º 7
0
        public static void Main(string[] arguments)
        {
            WindowsFormsSettings.LoadApplicationSettings();
            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);
            winApplication.CustomizeTemplate += new EventHandler <CustomizeTemplateEventArgs>(WinApplication_CustomizeTemplate);
            SecurityAdapterHelper.Enable();
            ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["ConnectionString"];
            if (connectionStringSettings != null)
            {
                winApplication.ConnectionString = connectionStringSettings.ConnectionString;
            }
            if (string.IsNullOrEmpty(winApplication.ConnectionString) && winApplication.Connection == null)
            {
                connectionStringSettings = ConfigurationManager.ConnectionStrings["SqlExpressConnectionString"];
                if (connectionStringSettings != null)
                {
                    string connectionString = connectionStringSettings.ConnectionString;
                    if (connectionString != InMemoryDataStoreProvider.ConnectionString)
                    {
                        connectionString = DemoDbEngineDetectorHelper.PatchSQLConnectionString(connectionString);
                        if (connectionString == DemoDbEngineDetectorHelper.AlternativeConnectionString)
                        {
                            connectionString = InMemoryDataStoreProvider.ConnectionString;
                            UseSQLAlternativeInfoSingleton.Instance.FillFields(DemoDbEngineDetectorHelper.SQLServerIsNotFoundMessage, DemoXPODatabaseHelper.AlternativeName, DemoXPODatabaseHelper.InMemoryDatabaseUsageMessage);
                        }
                    }
                    winApplication.ConnectionString = connectionString;
                }
            }
#if DEBUG
            foreach (string argument in arguments)
            {
                if (argument.StartsWith("-connectionString:"))
                {
                    string connectionString = argument.Replace("-connectionString:", "");
                    winApplication.ConnectionString = connectionString;
                }
            }
#endif
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            try {
                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e) {
                winApplication.StopSplash();
                winApplication.HandleException(e);
            }
        }