private void OnSplashDemoActionExecute(object sender, SimpleActionExecuteEventArgs args)
        {
            // Set the WinApplication.SplashScreen property to provide a splash screen for your application.
            WinApplication.SplashScreen = (ISplash)args.Action.Tag;
            // Call the SetDisplayText to provide the initial display text for your splash screen.
            WinApplication.SplashScreen.SetDisplayText(splashUpdates[0, 0]);

            // The following methods are called manually for demo purposes only.
            WinApplication.StartSplash();
            for (int i = 0; i < splashUpdates.Length / 2; i++)
            {
                if (WinApplication.SplashScreen is ISupportUpdateSplash)
                {
                    bool demoFlag = true;
                    if (demoFlag)
                    {
                        // You can also update your splash screen to notify users about current progress.
                        ((ISupportUpdateSplash)WinApplication.SplashScreen).UpdateSplash(splashUpdates[i, 0], splashUpdates[i, 1]);
                    }//OR
                    else
                    {
                        // This approach is good when you do not have access to a WinApplication, e.g,. in the ModuleUpdater class.
                        // You can also localize or customize built-in XAF status messages by overriding the XafApplication.UpdateStatus method (test the Context parameter with the DevExpress.ExpressApp.Localization.ApplicationStatusMesssageId enumeration value).
                        ((WinApplication)Application).UpdateStatus(splashUpdates[i, 0], "", splashUpdates[i, 1]);
                    }
                }
                Thread.Sleep(1500);
            }
            WinApplication.StopSplash();
        }
Esempio n. 2
0
        public RegistratorWindowsFormsApplication()
        {
            InitializeComponent();

            // используем статичное поле для хранения инстанса приложения
            // поле используем в кастомных формах
            Instance = this;
        }
 public static void HandleException(this WinApplication xpandWinApplication) {
     if (_xpandWinApplication == null)
         Application.ThreadException += (sender, args) => xpandWinApplication.HandleException(args.Exception);
     else {
         Application.ThreadException += (sender, args) => _xpandWinApplication.HandleException(args.Exception);
     }
     if (_xpandWinApplication == null)
         _xpandWinApplication = xpandWinApplication;
 }
 public static Form CreateModelEditorForm(WinApplication winApplication) {
     var modelDifferenceStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateUserModelDifferenceStore");
     var controller = new ModelEditorViewController(winApplication.Model,  modelDifferenceStore);
     var modelDifferencesStore = (ModelDifferenceStore) typeof(XafApplication).Invoke(winApplication, "CreateModelDifferenceStore");
     if (modelDifferencesStore != null) {
         var modulesDiffStoreInfo = new List<ModuleDiffStoreInfo> { new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model") };
         controller.SetModuleDiffStore(modulesDiffStoreInfo);
     }
     return new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)winApplication.Model).ModelEditorSettings));
 }
        public void If_PersiststentApp_AlreadyUpdated_Do_Not_Update_Again()
        {
            var instance = Isolate.Fake.Instance<ModelDifferenceBaseModule<XpoModelDictionaryDifferenceStore>>(Members.CallOriginal);
            var xafApplication = new WinApplication();

            instance.Setup(xafApplication);

            Isolate.Invoke.Event(() => xafApplication.LoggingOn += null, null, null);
//            Isolate.WhenCalled(() => modelDifferenceModule.UpdatePersistentApplication(null)).WillThrow(new Exception());
////            Isolate.WhenCalled(() => modelDifferenceModule.PersistentApplicationModelUpdated).WillReturn(true);
//            modelDifferenceModule.Setup();
//            Isolate.Invoke.Event(() => application.LoggingOn += null, new LogonEventArgs(null));
//            eventHandler.Invoke(this,new LogonEventArgs(null));
        }
        public static Form CreateModelEditorForm(WinApplication winApplication)
        {
            var modelDifferenceStore  = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateUserModelDifferenceStore");
            var controller            = new ModelEditorViewController(winApplication.Model, modelDifferenceStore);
            var modelDifferencesStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateModelDifferenceStore");

            if (modelDifferencesStore != null)
            {
                var modulesDiffStoreInfo = new List <ModuleDiffStoreInfo> {
                    new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model")
                };
                controller.SetModuleDiffStore(modulesDiffStoreInfo);
            }
            return(new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)winApplication.Model).ModelEditorSettings)));
        }
Esempio n. 7
0
 public static void HandleException(this WinApplication xpandWinApplication)
 {
     if (_xpandWinApplication == null)
     {
         Application.ThreadException += (sender, args) => xpandWinApplication.HandleException(args.Exception);
     }
     else
     {
         Application.ThreadException += (sender, args) => _xpandWinApplication.HandleException(args.Exception);
     }
     if (_xpandWinApplication == null)
     {
         _xpandWinApplication = xpandWinApplication;
     }
 }
Esempio n. 8
0
        private static void Main()
        {
            ImageLoader.Instance.UseSvgImages = true;
            using var app = new WinApplication()
                  {
                      UseLightStyle   = true,
                      UseOldTemplates = false
                  };

            app.CreateCustomObjectSpaceProvider += (s, e)
                                                   => e.ObjectSpaceProvider = new NonPersistentObjectSpaceProvider();

            try
            {
                app.Setup();
                app.Start();
            }
            catch (Exception ex)
            {
                app.HandleException(ex);
            }
        }
Esempio n. 9
0
        private static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = Debugger.IsAttached;

            var winApplication = new WinApplication();
            // Refer to the https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112680.aspx help article for more details on how to provide a custom splash form.
            winApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen("fdit_logo_350x392.png");
            IsGrantedAdapter.Enable(XPOSecurityAdapterHelper.GetXpoCachedRequestSecurityAdapters());
            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
            if (Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            try
            {
                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e)
            {
                winApplication.HandleException(e);
            }
        }
Esempio n. 10
0
 public MessageDialog(WinApplication application)
 {
     this.application = application;
 }
 public static IDisposable Initialize(this WinApplication winApplication)
 => ApplicationInitializer.Create(winApplication);
 public static ApplicationInitializer Create(WinApplication winApplication)
 => new ApplicationInitializer(winApplication);
 private ApplicationInitializer(WinApplication winApplication)
 {
     _App = (System.ComponentModel.ISupportInitialize)winApplication;
     _App.BeginInit();
 }
 protected override void OnDeactivated()
 {
     base.OnDeactivated();
     WinApplication.StopSplash();
 }