Hi Guys
We are building an Admin tool for our application which performs such tasks as editing the config file, creating the database, updating it, deleting objects where they have been deferred, editing the model etc.
When we call methods on DatabaseUpdater a small status window is displayed (the same as if you used the DBUpdater command line tool). Is there a way to suppress this since once it has finished its work, it won't go away until we exit our application. Setting the dbUpdater variable to Nothing does not clear it and DatabaseUpdater is not disposable.
Many thanks
John
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello John,
To solve this problem, you can access the WinApplication object, and execute the following code:
if (winApplication.SplashScreen != null) winApplication.SplashScreen.Stop();
If winApplication.SplashScreen IsNot Nothing Then winApplication.SplashScreen.Stop() End If
Does this suit you?
Thanks,
Dennis
Hello Guys
Sorry to resurect this but I am revisiting the admin program.
The code provided does not stop the dialog. Here is what I have (pretty much straight from the DBUpdater program)
If Not FilesAreValid() Then
Form.StatusMessage = "The Config file and/or Application executable cannot be found"
Return
End If
Dim connectionString As String = String.Empty
Dim modules As String = String.Empty
Dim tablePrefixes As String = String.Empty
GetDBUpdaterParameters(ConfigFileName, connectionString, modules, tablePrefixes)
Dim localDLLPath As String = Path.GetDirectoryName(ConfigFileName)
Dim diffsPath As String = Path.GetDirectoryName(ConfigFileName)
Dim dmf As New DesignerModelFactory()
Dim assembliesPath As String = String.Empty
Try
dmf.GetFileContainingApplicationType(ConfigFileName, ApplicationFileName, assembliesPath)
Catch ex As DesignerModelFactory_FindApplicationAssemblyException
Form.StatusMessage = "Unable to resolve Assemblies using given config path and name"
Return
Catch ex As Exception
Form.StatusMessage = ex.Message
Return
End Try
Dim application As XafApplication = dmf.CreateApplicationByConfigFile(ConfigFileName, ApplicationFileName, assembliesPath)
If Not String.IsNullOrEmpty(connectionString) Then
application.ConnectionString = connectionString
Else
Form.StatusMessage = "No ConnectionString was found in the config file"
Return
End If
If Not String.IsNullOrEmpty(tablePrefixes) Then
application.TablePrefixes = tablePrefixes
End If
Dim winApp As DevExpress.ExpressApp.Win.WinApplication = TryCast(application, WinApplication)
If winApp IsNot Nothing AndAlso winApp.SplashScreen IsNot Nothing Then
winApp.SplashScreen.Stop()
End If
application.Setup(application.ApplicationName, application.ConnectionString, modules.Split(";"))
Dim dbUpdater As New DatabaseUpdater(application.ObjectSpaceProvider, application.Modules, application.ApplicationName)
AddHandler dbUpdater.Progress, AddressOf dbUpdater_Progress
Dim cError As CompatibilityError = dbUpdater.CheckCompatibility()
If cError IsNot Nothing Then
' Analyse the message
Else
Form.StatusMessage = "The Database does not need updating"
End If
application.Dispose()
winApp is valid and the call to SplashScreen.Stop() runs but the "Loading" message does not disappear eaver after the application is disposed!
Any ideas?
Many thanks
John
Hi John,
Thank you for the update. We need additional time to research it. We will get back to you as soon as we can.
Thanks,
Michael.
Hello John,
The Stop method should be called after the splash screen is shown, i.e. after calling the application's Setup method. Otherwise, it will not produce any effect.
It appears that in your case it is better to remove SplashScreen at all. To do this, set the WinApplication.SplashScreen property to null before calling the Setup method.
Thanks,
Anatol
Thanks Anatol
All sorted!