Files
Mapo-IOB-WIN/IOB-UT-NEXT/Config/Base/ServerMapoDto.cs
T

68 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YamlDotNet.Core.Tokens;
namespace IOB_UT_NEXT.Config.Base
{
public class ServerMapoDto
{
/// <summary>
/// Restituisce la API del comando richiesto dalla BaseUrl
/// </summary>
/// <param name="CmdReq">Comando richiesto da comporre</param>
/// <returns></returns>
public string ApiUrl(string CmdReq)
{
// default ad implicito con IOB...
string answ = $"{BaseAppUrl}IOB/{CmdReq}/";
if (Commands.ContainsKey(CmdReq))
{
answ = $"{BaseAppUrl}{Commands[CmdReq]}";
}
// elimino doppie barre
answ = answ.Replace("//", "/");
return answ;
}
/// <summary>
/// URL Base del server applicativo
/// </summary>
public string BaseAppUrl { get; set; } = "/MP/IO/";
/// <summary>
/// Disabilitazione ping verso server
/// </summary>
public bool DisabPing { get; set; } = false;
/// <summary>
/// Disabilitazione keepalive aggiungendo opzione in URL
/// </summary>
public bool DisabKeepAlive { get; set; } = false;
/// <summary>
/// Dizionario comandi configurati
/// </summary>
public Dictionary<string, string> Commands { get; set; } = new CmdUriDto("IOB").StdCommands();
/// <summary>
/// Directory Installazione di riferimento x applicativi MAN/IOB sotto la radice C:\
/// </summary>
public string ClientInstall { get; set; } = "SteamWare";
/// <summary>
/// Indirizzo IP server
/// </summary>
public string IpAddr { get; set; } = "127.0.0.1";
/// <summary>
/// Indica il metodo di trasporto http/https
/// </summary>
public string Transport { get; set; } = "http";
}
}