66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using WebWindowTest.Json;
|
|
using static WebWindowTest.Json.WindowConst;
|
|
|
|
namespace WebWindowTest.Models
|
|
{
|
|
public class AGBOptionCombo : AGBOption
|
|
{
|
|
#region Public Constructors
|
|
|
|
public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam)
|
|
{
|
|
m_Type = HwOptionTypes.COMBO;
|
|
foreach (var Value in HdwOptionParam.Opzioni)
|
|
m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione));
|
|
m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", "");
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
public AGBOptionParameter sValue
|
|
{
|
|
get
|
|
{
|
|
return m_sValue;
|
|
}
|
|
set
|
|
{
|
|
m_sValue = value;
|
|
}
|
|
}
|
|
|
|
public List<AGBOptionParameter> ValueList
|
|
{
|
|
get
|
|
{
|
|
return m_ValueList;
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Internal Methods
|
|
|
|
internal override JsonHwOption Serialize()
|
|
{
|
|
JsonHwOption JsonHwOption = new JsonHwOption(sName, m_sValue.sValue);
|
|
return JsonHwOption;
|
|
}
|
|
|
|
#endregion Internal Methods
|
|
|
|
#region Private Fields
|
|
|
|
private AGBOptionParameter m_sValue;
|
|
private List<AGBOptionParameter> m_ValueList = new List<AGBOptionParameter>();
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |