111 lines
2.6 KiB
C#
111 lines
2.6 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 AGBOptionText : AGBOption
|
|
//{
|
|
// #region Public Constructors
|
|
|
|
// public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam)
|
|
// {
|
|
// m_Type = HdwOptionTypes.TEXT;
|
|
// m_sValue = HdwOptionParam.ValoreCorrente;
|
|
// }
|
|
|
|
// #endregion Public Constructors
|
|
|
|
// #region Public Properties
|
|
|
|
// public string sValue
|
|
// {
|
|
// get
|
|
// {
|
|
// return m_sValue;
|
|
// }
|
|
// set
|
|
// {
|
|
// m_sValue = value;
|
|
// }
|
|
// }
|
|
|
|
// #endregion Public Properties
|
|
|
|
// #region Private Fields
|
|
|
|
// private string m_sValue;
|
|
|
|
// #endregion Private Fields
|
|
//}
|
|
|
|
public class AGBOptionText : AGBOption
|
|
{
|
|
#region Public Constructors
|
|
|
|
public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam)
|
|
{
|
|
m_Type = HwOptionTypes.TEXT;
|
|
if(HdwOptionParam.Opzioni != null)
|
|
{
|
|
foreach (var Value in HdwOptionParam.Opzioni)
|
|
m_ValueList.Add(Value.Valore);
|
|
m_sValue = m_ValueList.FirstOrDefault(x => x == HdwOptionParam.ValoreCorrente);
|
|
if (string.IsNullOrEmpty(m_sValue))
|
|
m_sValue = m_ValueList.FirstOrDefault();
|
|
}
|
|
else
|
|
{
|
|
m_sValue = HdwOptionParam.ValoreCorrente;
|
|
}
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
public string sValue
|
|
{
|
|
get
|
|
{
|
|
return m_sValue;
|
|
}
|
|
set
|
|
{
|
|
m_sValue = value;
|
|
}
|
|
}
|
|
|
|
public List<string> ValueList
|
|
{
|
|
get
|
|
{
|
|
return m_ValueList;
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Internal Methods
|
|
|
|
internal override JsonHwOption Serialize()
|
|
{
|
|
JsonHwOption JsonHwOption = new JsonHwOption(sName, m_sValue);
|
|
return JsonHwOption;
|
|
}
|
|
|
|
#endregion Internal Methods
|
|
|
|
#region Private Fields
|
|
|
|
private string m_sValue;
|
|
private List<string> m_ValueList = new List<string>();
|
|
|
|
#endregion Private Fields
|
|
}
|
|
|
|
} |