Ok demo In/Out x AGB
This commit is contained in:
@@ -20,9 +20,6 @@ namespace FraMan.Core.HwInOut.AGB
|
||||
// se ho dati procedo
|
||||
if (!string.IsNullOrEmpty(rawXml))
|
||||
{
|
||||
// bonifica dati: es "True --> true
|
||||
rawXml = rawXml.Replace(">True<", ">true<");
|
||||
rawXml = rawXml.Replace(">False<", ">false<");
|
||||
// deserializzo
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(ParametriOpzioni));
|
||||
using (StringReader reader = new StringReader(rawXml))
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace FraMan.Core.HwInOut.AGB
|
||||
@@ -27,9 +28,30 @@ namespace FraMan.Core.HwInOut.AGB
|
||||
[XmlElement(ElementName = "Visible")]
|
||||
public bool Visible { get; set; }
|
||||
|
||||
[XmlElement(ElementName = "RicalcolaSeModificato")]
|
||||
//// Problemi di formattazione nel file con maiuscole/minuscole --> forzo decodifica sotto
|
||||
//[XmlElement(ElementName = "RicalcolaSeModificato")]
|
||||
//public bool RicalcolaSeModificato { get; set; }
|
||||
|
||||
|
||||
[XmlIgnore]
|
||||
public bool RicalcolaSeModificato { get; set; }
|
||||
|
||||
[XmlElement("RicalcolaSeModificato")]
|
||||
public string RicalcolaSeModificatoSerialize
|
||||
{
|
||||
get { return this.RicalcolaSeModificato ? "True" : "False"; }
|
||||
set
|
||||
{
|
||||
if (value.Equals("True", StringComparison.InvariantCultureIgnoreCase))
|
||||
this.RicalcolaSeModificato = true;
|
||||
else if (value.Equals("False", StringComparison.InvariantCultureIgnoreCase))
|
||||
this.RicalcolaSeModificato = false;
|
||||
else
|
||||
this.RicalcolaSeModificato = XmlConvert.ToBoolean(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[XmlElement(ElementName = "Opzioni")]
|
||||
public List<Opzioni> Opzioni { get; set; }
|
||||
}
|
||||
|
||||
+15
-6
@@ -11,7 +11,9 @@ namespace FraMan.Test
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
#region Private Methods
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
// effettua chaimata x test lettura parametri
|
||||
string separator = "---------------------------";
|
||||
@@ -38,18 +40,23 @@ namespace FraMan.Test
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Effettuata lettura dati:");
|
||||
int numPar = parOpt.Parametri.Count;
|
||||
Console.WriteLine($"Effettuata lettura dati, trovati {numPar} parametri:");
|
||||
Console.WriteLine(separator);
|
||||
int idx = 0;
|
||||
Console.WriteLine();
|
||||
int idx = 1;
|
||||
foreach (var item in parOpt.Parametri)
|
||||
{
|
||||
Console.WriteLine($"Par.{idx++:000}:");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine($"N. {idx++:000} / {numPar}");
|
||||
Console.WriteLine($"Nome: {item.NomeParametro}");
|
||||
Console.WriteLine($"Descr: {item.DescrizioneParametro}");
|
||||
Console.WriteLine($"Valore: {item.ValoreCorrente}");
|
||||
Console.WriteLine($"Visibile: {item.Visible}");
|
||||
Console.WriteLine($"Tipo: {item.Tipo}");
|
||||
|
||||
// se lista mostro opzioni:
|
||||
if(item.Tipo.ToLower()=="list")
|
||||
if (item.Tipo.ToLower() == "list")
|
||||
{
|
||||
int j = 0;
|
||||
Console.WriteLine($"# Opzioni ammesse: {item.Opzioni.Count}");
|
||||
@@ -67,5 +74,7 @@ namespace FraMan.Test
|
||||
Console.WriteLine("Premere un tasto per chiudere");
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user