|
@@ -312,13 +312,8 @@ namespace PRSDesktop
|
|
|
}
|
|
|
|
|
|
ProfileName.Content = App.Profile;
|
|
|
- URL.Content = DatabaseType switch
|
|
|
- {
|
|
|
- DatabaseType.Networked => ClientFactory.Parameters?.FirstOrDefault(),
|
|
|
- DatabaseType.Standalone => App.DatabaseSettings.FileName,
|
|
|
- DatabaseType.Local => App.DatabaseSettings.LocalServerName,
|
|
|
- _ => ""
|
|
|
- };
|
|
|
+ URL.Content = GetDatabaseConnectionDescription();
|
|
|
+
|
|
|
|
|
|
Progress.ShowModal("Starting Up", progress =>
|
|
|
{
|
|
@@ -330,6 +325,23 @@ namespace PRSDesktop
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ #region Connection Management
|
|
|
+
|
|
|
+ private string GetDatabaseConnectionDescription()
|
|
|
+ {
|
|
|
+ return DatabaseType switch
|
|
|
+ {
|
|
|
+#if RPC
|
|
|
+ DatabaseType.Networked => (ClientFactory.Parameters?.FirstOrDefault() as RpcClientSocketTransport)?.Host,
|
|
|
+#else
|
|
|
+ DatabaseType.Networked => ClientFactory.Parameters?.FirstOrDefault() as string,
|
|
|
+#endif
|
|
|
+ DatabaseType.Standalone => App.DatabaseSettings?.FileName,
|
|
|
+ DatabaseType.Local => App.DatabaseSettings?.LocalServerName,
|
|
|
+ _ => ""
|
|
|
+ } ?? "";
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Reconnect to the server.
|
|
|
/// </summary>
|
|
@@ -455,7 +467,9 @@ namespace PRSDesktop
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
private bool _loggingOut = false;
|
|
|
|
|
|
private void ClientFactory_OnRequestError(RequestException e)
|
|
@@ -621,8 +635,6 @@ namespace PRSDesktop
|
|
|
AddSetupAction(tab, "Email Templates", ManageEmailTemplates, PRSDesktop.Resources.email).SetSecurityToken<CanDesignReports>();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private void ConfigureMainScreen()
|
|
|
{
|
|
|
|
|
@@ -3635,7 +3647,7 @@ namespace PRSDesktop
|
|
|
DatabaseType.Networked => Update.GetRemoteFile($"{location}/version").Content,
|
|
|
DatabaseType.Standalone or DatabaseType.Local => File.ReadAllText(Path.Combine(location, "version.txt")),
|
|
|
_ => "",
|
|
|
- };
|
|
|
+ } ?? "";
|
|
|
}
|
|
|
private string GetReleaseNotes(string location)
|
|
|
{
|
|
@@ -3644,7 +3656,7 @@ namespace PRSDesktop
|
|
|
DatabaseType.Networked => Update.GetRemoteFile($"{location}/releasenotes").Content,
|
|
|
DatabaseType.Standalone or DatabaseType.Local => File.ReadAllText(Path.Combine(location, "Release Notes.txt")),
|
|
|
_ => "",
|
|
|
- };
|
|
|
+ } ?? "";
|
|
|
}
|
|
|
private byte[]? GetInstaller(string location)
|
|
|
{
|