apc-viewer/APC Viewer/Models/AppSettings.cs

46 lines
1.4 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace APCViewer.Models;
public class AppSettings
{
protected string _Company;
protected string _EncryptedPassword;
protected string _MonARessource;
protected string _Server;
protected string _ServiceUser;
protected string _URLs;
protected string _WorkingDirectoryName;
public string Company => _Company;
public string EncryptedPassword => _EncryptedPassword;
public string MonARessource => _MonARessource;
public string Server => _Server;
public string ServiceUser => _ServiceUser;
public string URLs => _URLs;
public string WorkingDirectoryName => _WorkingDirectoryName;
// public AppSettings()
// {
// }
[JsonConstructor]
public AppSettings(string company, string encryptedPassword, string monARessource, string server, string serviceUser, string urls, string workingDirectoryName)
{
_Company = company;
_EncryptedPassword = encryptedPassword;
_MonARessource = monARessource;
_Server = server;
_ServiceUser = serviceUser;
_URLs = urls;
_WorkingDirectoryName = workingDirectoryName;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}