This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WinApplication.cs
31 lines (30 loc) · 1.75 KB
/
WinApplication.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win;
using System.Collections.Generic;
using DevExpress.ExpressApp.Updating;
using DevExpress.ExpressApp.Xpo;
namespace CustomizeNewActionItemsListExample.Win {
// For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/DevExpressExpressAppWinWinApplicationMembersTopicAll.aspx
public partial class CustomizeNewActionItemsListExampleWindowsFormsApplication : WinApplication {
public CustomizeNewActionItemsListExampleWindowsFormsApplication() {
InitializeComponent();
LinkNewObjectToParentImmediately = false;
}
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 CustomizeNewActionItemsListExampleWindowsFormsApplication_CustomizeLanguagesList(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);
}
}
private void CustomizeNewActionItemsListExampleWindowsFormsApplication_DatabaseVersionMismatch(object sender, DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs e) {
e.Updater.Update();
e.Handled = true;
}
}
}