void application_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { if (provider != null && !provider.IsInitialized) { provider.Initialize(((XPObjectSpaceProvider)e.ObjectSpaceProvider).XPDictionary, ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, ConfigurationManager.ConnectionStrings["LogConnectionString"].ConnectionString); } }
/// <summary> /// Applications the custom check compatibility. Create and initialize data store provider. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="DevExpress.ExpressApp.CustomCheckCompatibilityEventArgs"/> instance containing the event data.</param> private void application_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { if (provider == null || provider.IsInitialized) return; var application = (XafApplication)sender; var providerType = application.ObjectSpaceProvider.GetType(); var dict = (XPDictionary)providerType.GetProperty("XPDictionary").GetValue(application.ObjectSpaceProvider, null); var connStr = application.Connection == null ? application.ConnectionString : application.Connection.ConnectionString; provider.Initialize(dict, connStr, ssConnectionString, ssTypes); }
private void Application_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { Application.CustomCheckCompatibility -= Application_CustomCheckCompatibility; e.Handled = true; IObjectSpace objectSpace = e.ObjectSpaceProvider.CreateObjectSpace(); if (objectSpace != null) { Updater updater = new Updater(objectSpace, new Version()); updater.UpdateDatabaseAfterUpdateSchema(); } }
/// <summary> /// Applications the custom check compatibility. Create and initialize data store provider. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="DevExpress.ExpressApp.CustomCheckCompatibilityEventArgs"/> instance containing the event data.</param> private void application_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { if (provider == null || provider.IsInitialized) { return; } var application = (XafApplication)sender; var providerType = application.ObjectSpaceProvider.GetType(); var dict = (XPDictionary)providerType.GetProperty("XPDictionary").GetValue(application.ObjectSpaceProvider, null); var connStr = application.Connection == null ? application.ConnectionString : application.Connection.ConnectionString; provider.Initialize(dict, connStr, ssConnectionString, ssTypes); }
//private void ShellWindowsFormsApplication_DatabaseVersionMismatch(object sender, DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs e) //{ // e.Handled = true; // //#if EASYTEST // // e.Updater.Update(); // // e.Handled = true; // //#else // // if (System.Diagnostics.Debugger.IsAttached) // // { // // e.Updater.Update(); // // e.Handled = true; // // } // // else // // { // // throw new InvalidOperationException( // // "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application.\r\n" + // // "This error occurred because the automatic database update was disabled when the application was started without debugging.\r\n" + // // "To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " + // // "source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " + // // "or manually create a database using the 'DBUpdater' tool.\r\n" + // // "Anyway, refer to the 'Update Application and Database Versions' help topic at http://help.devexpress.com/#Xaf/CustomDocument2795 " + // // "for more detailed information. If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/"); // // } // //#endif //} private void ShellWindowsFormsApplication_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { e.Handled = true; }
protected override void OnCustomCheckCompatibility(CustomCheckCompatibilityEventArgs args) { if (Info.GetChildNode("Options").GetAttributeBoolValue("DisableCompatibilityCheck", false)) args.Handled = true; base.OnCustomCheckCompatibility(args); }
protected override void OnCustomCheckCompatibility(CustomCheckCompatibilityEventArgs args) { args.Handled = true; base.OnCustomCheckCompatibility(args); }
private void Application_CustomCheckCompatibility(object sender, CustomCheckCompatibilityEventArgs e) { //... //Console.WriteLine(e.ApplicationName); }