1 Commits

Author SHA1 Message Date
cb6c007480 Aggiunta impostazione server URL 2026-02-12 09:42:45 +01:00
5 changed files with 79 additions and 1 deletions

15
App.config Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="PizzaExpress_Client.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<PizzaExpress_Client.Properties.Settings>
<setting name="serverUrl" serializeAs="String">
<value>http://localhost:5000</value>
</setting>
</PizzaExpress_Client.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1,3 +1,4 @@
using System.Configuration;
using System.Net.Http.Json;
namespace PizzaExpress_Client
@@ -29,7 +30,7 @@ namespace PizzaExpress_Client
MaximizeBox = false;
StartPosition = FormStartPosition.CenterScreen;
_httpClient = new HttpClient { BaseAddress = new Uri("http://localhost:5000/") };
_httpClient = new HttpClient { BaseAddress = new Uri(Properties.Settings.Default.serverUrl) };
// ======================================================
// PANNELLO SUPERIORE

View File

@@ -9,4 +9,19 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

38
Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Il codice è stato generato da uno strumento.
// Versione runtime:4.0.30319.42000
//
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
// il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PizzaExpress_Client.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:5000")]
public string serverUrl {
get {
return ((string)(this["serverUrl"]));
}
set {
this["serverUrl"] = value;
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="PizzaExpress_Client.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="serverUrl" Type="System.String" Scope="User">
<Value Profile="(Default)">http://localhost:5000</Value>
</Setting>
</Settings>
</SettingsFile>