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();
        }
예제 #2
0
        public RegistratorWindowsFormsApplication()
        {
            InitializeComponent();

            // используем статичное поле для хранения инстанса приложения
            // поле используем в кастомных формах
            Instance = this;
        }
예제 #3
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;
 }
예제 #4
0
 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));
 }
예제 #5
0
        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));
        }
예제 #6
0
        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)));
        }
예제 #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;
     }
 }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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();
 }