Private/New-XafProject/WinApplication.cs
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win; using DevExpress.ExpressApp.Win.Utils; using DevExpress.ExpressApp.Xpo; namespace $SolutionName.Win{ public class WinApplication: DevExpress.ExpressApp.Win.WinApplication{ #region Default XAF configuration options (https://www.devexpress.com/kb=T501418) static WinApplication() { DevExpress.Persistent.Base.PasswordCryptographer.EnableRfc2898 = true; DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false; DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true; } private void InitializeDefaults() { LinkNewObjectToParentImmediately = false; OptimizedControllersCreation = true; UseLightStyle = true; // SplashScreen = new DXSplashScreen(typeof(XafSplashScreen), new DefaultOverlayFormOptions()); ExecuteStartupLogicBeforeClosingLogonWindow = true; } #endregion public WinApplication() { InitializeDefaults(); DatabaseVersionMismatch += (sender, e) => { e.Updater.Update(); e.Handled = true; }; CustomizeLanguagesList+=OnCustomizeLanguagesList; } protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); } private void OnCustomizeLanguagesList(object sender, CustomizeLanguagesListEventArgs e) { string userLanguageName = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; if(userLanguageName != "en-US" && e.Languages.IndexOf(userLanguageName) == -1) { e.Languages.Add(userLanguageName); } } } } |