Browse Source

Commented out some broken XAML and fixed the URL being displayed at the bottom as InABox.RPC or something. (Now uses "Host" on the socket transport to display URL)

Kenric Nugteren 2 years ago
parent
commit
bf9c029251
2 changed files with 26 additions and 15 deletions
  1. 24 12
      prs.desktop/MainWindow.xaml.cs
  2. 2 3
      prs.desktop/Panels/Staging/StagingPanel.xaml

+ 24 - 12
prs.desktop/MainWindow.xaml.cs

@@ -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)
         {

+ 2 - 3
prs.desktop/Panels/Staging/StagingPanel.xaml

@@ -9,10 +9,9 @@
              d:DesignHeight="450" d:DesignWidth="800">
 
     <dynamicgrid:DynamicSplitPanel x:Name="mainPanel" View="Combined" MasterCaption="Setouts Folder">
-
-        <dynamicgrid:DynamicSplitPanel.Master>
+        <!--dynamicgrid:DynamicSplitPanel.Master>
             
-        </dynamicgrid:DynamicSplitPanel.Master>
+        </dynamicgrid:DynamicSplitPanel.Master-->
         
         <dynamicgrid:DynamicSplitPanel.Detail>
             <dynamicgrid:DynamicSplitPanel x:Name="nestedPanel">